Chenlong-Tao/MCPFastDemo
If you are the rightful owner of MCPFastDemo and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.
This is a simple MCP (Model Context Protocol) server example, suitable for beginners to understand and learn the basic concepts and usage of MCP.
MCP (Model Context Protocol) is a protocol that allows AI models, such as Claude, to interact with external tools and resources. Through MCP, AI can access real-time data, perform computations, or communicate with other systems, thereby extending its capabilities. This repository contains a simple MCP server example that provides basic functionalities to help users get started with MCP. It includes tools for performing basic arithmetic operations, generating personalized greetings, and analyzing code snippets.
Features
- Addition Tool: A simple tool that can add two numbers.
- Greeting Resource: A dynamic resource that returns personalized greetings based on the provided name.
- Code Analysis Prompt: A template for in-depth code analysis.
Usages
local integration stdio
python mcp.run(transport='stdio') # Tools defined via @mcp.tool() decorator
local integration subprocess
python command='uv', args=['run', 'server.py'] # Launch using virtual environment
remote integration sse
python mcp.run(transport='sse', host="0.0.0.0", port=8000) # Specify SSE endpoint
remote integration streamable http
yaml paths: /mcp: post: x-ms-agentic-protocol: mcp-streamable-1.0 # Copilot Studio integration
platform integration github
{"command": "docker", "args": ["run", "-e", "GITHUB_PERSONAL_ACCESS_TOKEN", "ghcr.io/github/github-mcp-server"]}
development framework fastmcp
python from mcp.server import FastMCP app = FastMCP('demo') @app.tool() async def query(): ...
Tools
Addition Tool
A tool to add two numbers.