Sponsored by Deepsite.site

Simple MCP Server

Created By
rjmoggach7 months ago
A basic stdio & streamable http implementation of FastMCP Server
Content

Simple MCP Server

A minimal implementation of the Model Context Protocol (MCP) server using FastMCP. This example demonstrates how to create a simple MCP server that clients like Windsurf IDE and Claude can connect to.

What is MCP?

The Model Context Protocol (MCP) is a standard that connects LLMs with external tools and data sources. MCP servers extend AI capabilities by providing access to specialized tools, external information, and services.

Features

  • Dual transport support (HTTP and stdio)
  • Simple authentication middleware for HTTP transport
  • Example tools implementation
  • Compatible with MCP clients like Windsurf IDE and Claude

Prerequisites

Installation

  1. Clone this repository:

    git clone https://github.com/rjmoggach/simple-mcp-server.git
    cd simple-mcp-server
    
  2. Install dependencies:

    uv sync
    

Usage

You can run the server in three different modes:

Run with both transports (default)

python run_server.py

This will start the HTTP server on port 9876 and the stdio server simultaneously.

HTTP transport only

python run_server.py --http-only

stdio transport only

python run_server.py --stdio-only

Available Tools

The server provides these example tools:

  1. hello_world - A simple greeting tool

    • Parameters:
      • name (string, default: "World"): Name to greet
      • delay (integer, default: 0): Optional delay in seconds
    • Returns: A greeting message
  2. get_version - Returns server version information

    • Returns: Version details including server name and API version
  3. system_info - Returns basic system information

    • Returns: Python version and platform details

Connecting to AI Systems

Windsurf IDE Configuration

Add the following configuration to your Windsurf IDE settings:

"simple-mcp": {
  "command": "npx",
  "args": [
    "mcp-remote", 
    "http://localhost:9876/", 
    "--allow-http", 
    "--header", 
    "Authorization: Bearer SIMPLE_MCP_SERVER"
  ]
}

Claude Desktop Configuration

Add the following to your Claude Desktop configuration:

{
  "mcpServers": {
    "simple-mcp": {
      "command": "uv",
      "args": [
        "run", 
        "--project", "/path/to/simple-mcp-server", 
        "python", "/path/to/simple-mcp-server/run_server.py", 
        "--stdio-only"
      ],
      "cwd": "/path/to/simple-mcp-server"
    }
  }
}

Replace /path/to/simple-mcp-server with the actual path to your project.

Authentication

For HTTP transport, the server uses a simple token-based authentication:

  • Token: SIMPLE_MCP_SERVER (defined in run_server.py)
  • Header format: Authorization: Bearer SIMPLE_MCP_SERVER

Extending the Server

To add your own tools, modify the create_mcp_server() function in run_server.py:

@mcp.tool()
async def your_custom_tool(param1: str, param2: int = 0) -> dict:
    """Your custom tool description."""
    # Implementation here
    return {"result": "Your output"}

License

MIT License

Recommend Servers
TraeBuild with Free GPT-4.1 & Claude 3.7. Fully MCP-Ready.
Playwright McpPlaywright MCP server
Jina AI MCP ToolsA Model Context Protocol (MCP) server that integrates with Jina AI Search Foundation APIs.
Zhipu Web SearchZhipu Web Search MCP Server is a search engine specifically designed for large models. It integrates four search engines, allowing users to flexibly compare and switch between them. Building upon the web crawling and ranking capabilities of traditional search engines, it enhances intent recognition capabilities, returning results more suitable for large model processing (such as webpage titles, URLs, summaries, site names, site icons, etc.). This helps AI applications achieve "dynamic knowledge acquisition" and "precise scenario adaptation" capabilities.
EdgeOne Pages MCPAn MCP service designed for deploying HTML content to EdgeOne Pages and obtaining an accessible public URL.
AiimagemultistyleA Model Context Protocol (MCP) server for image generation and manipulation using fal.ai's Stable Diffusion model.
TimeA Model Context Protocol server that provides time and timezone conversion capabilities. This server enables LLMs to get current time information and perform timezone conversions using IANA timezone names, with automatic system timezone detection.
ChatWiseThe second fastest AI chatbot™
Howtocook Mcp基于Anduin2017 / HowToCook (程序员在家做饭指南)的mcp server,帮你推荐菜谱、规划膳食,解决“今天吃什么“的世纪难题; Based on Anduin2017/HowToCook (Programmer's Guide to Cooking at Home), MCP Server helps you recommend recipes, plan meals, and solve the century old problem of "what to eat today"
BlenderBlenderMCP connects Blender to Claude AI through the Model Context Protocol (MCP), allowing Claude to directly interact with and control Blender. This integration enables prompt assisted 3D modeling, scene creation, and manipulation.
DeepChatYour AI Partner on Desktop
WindsurfThe new purpose-built IDE to harness magic
CursorThe AI Code Editor
Tavily Mcp
Serper MCP ServerA Serper MCP Server
Context7Context7 MCP Server -- Up-to-date code documentation for LLMs and AI code editors
MCP AdvisorMCP Advisor & Installation - Use the right MCP server for your needs
Amap Maps高德地图官方 MCP Server
Baidu Map百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Visual Studio Code - Open Source ("Code - OSS")Visual Studio Code
MiniMax MCPOfficial MiniMax Model Context Protocol (MCP) server that enables interaction with powerful Text to Speech, image generation and video generation APIs.