Back to Home
RealGustavoHerrera icon

mcp-basics

Verified Safe

by 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

Run Command
python3 -m mcp_client mcp_server/mcp_server.py --chat

Environment 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

Stats

Interest Score0
Security Score9
Cost ClassMedium
Avg Tokens250
Stars0
Forks0
Last Update2026-01-19

Tags

MCPAI AgentsPythonClient-ServerTool Calling