Sponsored by Deepsite.site

Simple MCP Server

Created By
marlinspike7 months ago
A simple MCP server that can be tested with a client
Content

MCP SimpleServer

A simple example of an MCP Server that can be used to test MCP clients.

Usage

  1. Clone the repository: git clone

  2. Navigate to the project directory: cd simpleserver

  3. Install the required dependencies: uv sync if you have uv installed, or pip install -r requirements.txt if you're using pip. I strongly recommend using uv as it is faster and more efficient, and it's required for the commands below.

  4. Create a .env file in the root of the project and add the following Keys (see .env.example):

WEATHER_API_KEY=xxx
OPENAI_API_KEY=sk-
NOTES_FILE="/tmp/notes.md"

You can get a free OpenWeatherMap API key from https://openweathermap.org/api and an OpenAI API key from https://platform.openai.com/signup.

Testing a Weather MCP Server (main.py)

  1. Run the server: uv run mcp dev main.py This will start the server, and you can browse to it at localhost (default port is 6274)
  2. Open a browser to http://127.0.0.1:6274
  3. Click "Connect"
  4. Click "Tools" in the top menu
  5. Click "List Tools"

You should now see two methods, "add" and "get_weather".

  1. Click "get_weather", and enter the name of a city (e.g., "London") in the input field.
  2. Click "Run Tool". If you've got a Weather API key set up, you should see the weather for that city.

Testing a Note Keeper (simplenote.py)

  1. Run the server: uv run mcp dev simplenote.py This will start the server, and you can browse to it at localhost (default port is 6274)
  2. Open a browser to http://localhost:6274
  3. Click "Connect"
  4. Click "Tools" in the top menu
  5. Click "List Tools" You should now see two methods, "add_note", "get_notes" and "get_last_note".

You can use these commands to Add a note, Get all Notes, or get just the last note. Entries will persist, as they're saved to a local file.

Testing the MCP Server with an OpenAI Agent (aiagent.py)

MCP really shines when it's used with an OpenAI Agent. You can chat with an OpenAI Model, and have it call the MCP Server to get information and perform custom actions. Run the app: uv run aiagent.py

Chat away! It will call the MCP Server when you ask it to perform actions that are defined in the MCP Server: - Add a note - Get all notes - Get the last note

How MCP with an Agent works

  • Loads environment variables (including your OpenAI API key) from a .env file.
  • Starts the SimpleNotes MCP server as a subprocess.
  • Creates an Agent with instructions to handle both note management and general queries.
  • Runs an interactive chat loop:
  • Prompts the user for input.
  • Sends the input to the agent, which uses the MCP server and OpenAI model to generate a response.
  • Prints the assistant’s reply.
  • Handles graceful exit on "quit", Ctrl+C, or EOF.
Recommend Servers
TraeBuild with Free GPT-4.1 & Claude 3.7. Fully MCP-Ready.
Visual Studio Code - Open Source ("Code - OSS")Visual Studio Code
Serper MCP ServerA Serper MCP Server
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.
MCP AdvisorMCP Advisor & Installation - Use the right MCP server for your needs
Context7Context7 MCP Server -- Up-to-date code documentation for LLMs and AI code editors
WindsurfThe new purpose-built IDE to harness magic
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.
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.
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.
Playwright McpPlaywright MCP server
ChatWiseThe second fastest AI chatbot™
Baidu Map百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
MiniMax MCPOfficial MiniMax Model Context Protocol (MCP) server that enables interaction with powerful Text to Speech, image generation and video generation APIs.
DeepChatYour AI Partner on Desktop
CursorThe AI Code Editor
Amap Maps高德地图官方 MCP Server
Tavily Mcp
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"