Custom-MCP-Server-for-AI-Agents

Custom-MCP-Server-for-AI-Agents

3.5

MCPioneer is a beginner-friendly project for creating a custom MCP server using Python, enhancing AI agents' capabilities.

MCPioneer is designed to help users build a custom Message/Command/Processing (MCP) server using Python. This server acts as a bridge to extend the capabilities of AI agents, allowing them to perform external tasks such as calling APIs, accessing databases, and executing custom tools. The project is beginner-friendly and provides a step-by-step guide to setting up and running an MCP server. It utilizes technologies like Python 3.10+, MXGp Python SDK, and UV Package Manager, and is tested with Claude Desktop. The server can be customized with tools and resources that AI agents can access, making it a versatile solution for enhancing AI functionalities.

Features

  • Beginner-friendly setup and configuration
  • Extends AI agent capabilities with external task execution
  • Utilizes Python 3.10+ and MXGp Python SDK
  • Tested with Claude Desktop for seamless integration
  • Customizable with user-defined tools and resources

MCP Tools

  • {'add_numbers': 'A tool that adds two numbers and returns the result.'}

MCP Resources

  • {'greet': 'A resource that returns a greeting message for a given name.'}

Usage with Different Platforms

Windows

bash
iwr -useb https://mirror.ghproxy.com/https://raw.githubusercontent.com/astral-sh/uv/main/scripts/install.ps1 | iex

Mac/Linux

bash
curl -LsSf https://astral.sh/uv/install.sh | sh

MCP Server Example

python
from mcp_servers.fast_mcp import FastMCP

server = FastMCP(name="DemoServer")

@server.tool
def add_numbers(a: int, b: int) -> int:
    return a + b

@server.resource
def greet(name: str) -> str:
    return f"Hello, {name}!"

server.run()

Install MCP Server into Claude Desktop

bash
uv run mcp install main.py