PyMcp
Verified Safeby raffaeler
Overview
Demonstrates a sample Model Context Protocol (MCP) server with basic text processing and AI integration using the Python FastMCP library.
Installation
docker run -i sample-mcp-serverEnvironment Variables
- MCP_SERVER_HOST
- MCP_SERVER_PORT
- OPENAI_API_KEY
Security Notes
The server's code does not contain 'eval', obfuscation, or hardcoded secrets. It uses `os.getenv` for configuration (host/port) and `python-dotenv` for loading environment variables. The `oneLiner` tool utilizes `context.sample()` to interact with an external AI model. This interaction implicitly relies on an LLM setup (e.g., API keys), and the `include_context='thisServer'` parameter means this server's tools could be called by the LLM. While this is part of FastMCP's design, it requires awareness regarding potential prompt injection if user inputs are not adequately handled by the underlying LLM system, though no direct vulnerability is observed in the provided server code.
Similar Servers
Expense-tracker-mcp
The server provides an API for tracking and managing personal expenses, allowing users to add, list, delete, update, and query expense records.
mcp-demo
This project is a demonstration of an MCP (Model Context Protocol) server built using the FastMCP framework, providing tools and resources for AI models to interact with.
MCP-Servers-using-Python
Demonstrates how to build Model Context Protocol (MCP) servers using `fastmcp` and `fastapi_mcp` libraries through various examples.
mcp-server-demo
This server demonstrates a basic implementation of the Multi-Modal Compute Protocol (MCP) using the FastMCP framework, exposing a simple 'hello' tool over HTTP or standard I/O for agent interaction.