MCP ExplorerExplorer

Mcp Agent Sandbox

@Lamaq-Mujpurwalaon 15 days ago
1 MIT
FreeCommunity
AI Systems
A hands-on starter project to build and test local tools using the Model Context Protocol (MCP) with Python, LangChain, and Claude. Includes a complete guide to setting up an MCP server-client architecture and integrating LLMs for real-world use cases.

Overview

What is Mcp Agent Sandbox

mcp-agent-sandbox is a hands-on starter project designed to build and test local tools using the Model Context Protocol (MCP) with Python, LangChain, and Claude. It provides a complete guide for setting up an MCP server-client architecture and integrating large language models (LLMs) for practical applications.

Use cases

Use cases for mcp-agent-sandbox include developing AI agents that can interact with external tools, testing local AI applications, and creating educational projects that demonstrate the capabilities of the Model Context Protocol.

How to use

To use mcp-agent-sandbox, clone the repository from GitHub, initialize the environment using the uv package manager, and set up a virtual environment. Follow the documentation to create necessary folders and load the MCP Python SDK README into Claude Desktop for generating server and client applications.

Key features

Key features of mcp-agent-sandbox include integration with the MCP Python SDK, support for LangChain and Claude, a structured setup for server-client architecture, and practical examples for building AI agents that utilize local tools.

Where to use

mcp-agent-sandbox can be used in various fields such as artificial intelligence development, software testing, and educational purposes, particularly for those looking to implement LLMs in real-world scenarios.

Content

MCP Agent Python Starter (Built on MCP SDK)

A practical starter project using the [Model Context Protocol (MCP)] to demonstrate how to build local tool-using AI agents with Claude, LangChain, and Groq.

📚 Reference

This project is built on top of the official MCP Python SDK and follows the Model Context Protocol specification.

Model Context Protocol (MCP) – Python Implementation


🧠 What is MCP?

Model Context Protocol (MCP) is a standard developed by Anthropic to allow large language models (LLMs) to interact with external tools and environments. It introduces a communication method where the LLM acts as a “client” and interacts with tools via a “server” using a standardized transport layer like STDIO or SSE.


🛠️ Prerequisites

Make sure you have the following installed:


📦 Dependencies

  • mcp[cli] (via uv)
  • langchain
  • langchain_openai
  • langchain_groq
  • python-dotenv

📦 Installation

# Clone the repo
git clone https://github.com/yourusername/model-context-protocol.git
cd model-context-protocol

# Initialize environment using uv
uv init

# Create folders
mkdir server docs testcode

# Create and activate virtual environment
uv venv
source .venv/bin/activate  # Windows: .venv\Scripts\activate

📄 Documentation Setup

  • Download the MCP Python SDK README
  • Save it in your docs/ folder.
  • Load it into Claude Desktop and prompt it to generate a server and client using that reference.

✍️ Tip: Be specific in your prompts.

▶️ Running the Client

In a new terminal window:

source .venv/bin/activate  # Reactivate env
uv add mcp-use langchain langchain_groq python-dotenv

Create a .env file:

env
GROQ_API_KEY=your_groq_api_key  # Get from groq.com

Run the client:

uv run path/to/your_client_file.py

🧪 Testing with Claude
You can also install your tool config to Claude:

uv install mcp path/to/your_server_file.py

This creates a config file that lets Claude Desktop access your tool natively for use in prompts.

⚠️ Note: This project uses the open-source MCP SDK (MIT Licensed). This repository itself is for demonstration purposes and retains custom licensing. See LICENSE for terms.

Tools

No tools

Comments