mcp-basics
Verified Safeby RealGustavoHerrera
Overview
A minimal example of building an MCP client and server in Python for connecting AI models to external tools and data, demonstrating AI agent capabilities.
Installation
python3 -m mcp_client mcp_server/mcp_server.py --chatEnvironment Variables
- OPENAI_API_KEY
Security Notes
The server runs locally as a subprocess of the client, communicating via stdin/stdout, which limits network exposure. OpenAI API key is loaded from a `.env` file, following good security practice for secrets. File I/O for resources is handled safely. The main theoretical risk would be if a malicious `server_path` were provided to the client without robust validation, but in the context of this project, it's designed to run its own trusted server script.
Similar Servers
zeromcp
A minimal, pure Python Model Context Protocol (MCP) server for exposing tools, resources, and prompts via HTTP/SSE and Stdio transports.
agents-mcp-usage
This repository demonstrates the integration of a Model Context Protocol (MCP) server with various AI agent frameworks, showcasing agent communication and operation within a shared context.
mcp_server
This server template provides a foundation for building Model Context Protocol (MCP) servers to integrate with AI assistants and other MCP clients, offering tools for GitHub, Microsoft Graph, weather data, and JWT decoding.
Sample-MCP-client-and-Server
A minimal example of an MCP (Model Context Protocol) server and client demonstrating basic tool exposure and invocation.