# Model Context Protocol Servers The Model Context Protocol (MCP) is an open standard that enables seamless integration between Large Language Models (LLMs) and external data sources, tools, and services. This repository provides a collection of reference server implementations that demonstrate the versatility and extensibility of MCP, showcasing how it gives AI assistants secure, controlled access to diverse capabilities. MCP servers act as bridges between LLMs and various systems, exposing tools, resources, and prompts through a standardized JSON-RPC interface. Each server in this repository implements specific functionality—from filesystem operations to knowledge graph memory, from web content fetching to Git repository management—demonstrating real-world integration patterns that developers can learn from and build upon. ## API Documentation and Code Examples ### Filesystem MCP Server Secure file operations with configurable access controls ```bash # Claude Desktop configuration (Docker) { "mcpServers": { "filesystem": { "command": "docker", "args": [ "run", "-i", "--rm", "--mount", "type=bind,src=/Users/username/Desktop,dst=/projects/Desktop", "mcp/filesystem", "/projects" ] } } } ``` ```bash # NPX installation npx -y @modelcontextprotocol/server-filesystem /Users/username/Desktop ``` ```typescript // Tool: read_text_file - Read complete contents of a file { "name": "read_text_file", "arguments": { "path": "/projects/Desktop/config.json", "head": 50 // Optional: first 50 lines only } } // Response { "content": [ { "type": "text", "text": "{\n \"name\": \"example\",\n \"version\": \"1.0.0\"\n}" } ] } ``` ```typescript // Tool: edit_file - Make selective edits using pattern matching { "name": "edit_file", "arguments": { "path": "/projects/app.js", "edits": [ { "oldText": "const port = 3000;", "newText": "const port = process.env.PORT || 3000;" } ], "dryRun": true // Preview changes first } } // Response shows diff preview { "content": [ { "type": "text", "text": "--- app.js\n+++ app.js\n@@ -1,1 +1,1 @@\n-const port = 3000;\n+const port = process.env.PORT || 3000;" } ] } ``` ```typescript // Tool: search_files - Recursively search with glob patterns { "name": "search_files", "arguments": { "path": "/projects", "pattern": "**/*.ts", "excludePatterns": ["**/node_modules/**", "**/dist/**"] } } // Response { "content": [ { "type": "text", "text": "/projects/src/index.ts\n/projects/src/server.ts\n/projects/tests/test.ts" } ] } ``` ### Fetch MCP Server Web content fetching and conversion for efficient LLM usage ```bash # Claude Desktop configuration (UV) { "mcpServers": { "fetch": { "command": "uvx", "args": ["mcp-server-fetch"] } } } ``` ```python # Install via pip pip install mcp-server-fetch python -m mcp_server_fetch ``` ```typescript // Tool: fetch - Retrieve and convert web content to markdown { "name": "fetch", "arguments": { "url": "https://example.com/article", "max_length": 5000, "start_index": 0 } } // Response { "content": [ { "type": "text", "text": "# Article Title\n\nArticle content in markdown format..." } ] } ``` ```typescript // Tool: fetch - Get raw HTML without markdown conversion { "name": "fetch", "arguments": { "url": "https://api.example.com/data", "raw": true } } // Response returns raw content { "content": [ { "type": "text", "text": "..." } ] } ``` ```bash # Custom user agent and proxy configuration uvx mcp-server-fetch --user-agent="MyBot/1.0" --proxy-url="http://proxy:8080" ``` ### Memory MCP Server Knowledge graph-based persistent memory system ```bash # Claude Desktop configuration (NPX) { "mcpServers": { "memory": { "command": "npx", "args": ["-y", "@modelcontextprotocol/server-memory"], "env": { "MEMORY_FILE_PATH": "/path/to/memory.json" } } } } ``` ```typescript // Tool: create_entities - Create nodes in knowledge graph { "name": "create_entities", "arguments": { "entities": [ { "name": "John_Smith", "entityType": "person", "observations": ["Software engineer", "Lives in San Francisco", "Speaks Python and Go"] }, { "name": "Acme_Corp", "entityType": "organization", "observations": ["Tech startup", "Founded in 2020"] } ] } } // Response { "content": [ { "type": "text", "text": "Created 2 entities: John_Smith, Acme_Corp" } ] } ``` ```typescript // Tool: create_relations - Connect entities with relationships { "name": "create_relations", "arguments": { "relations": [ { "from": "John_Smith", "to": "Acme_Corp", "relationType": "works_at" }, { "from": "John_Smith", "to": "Python_Programming", "relationType": "skilled_in" } ] } } // Response { "content": [ { "type": "text", "text": "Created 2 relations" } ] } ``` ```typescript // Tool: search_nodes - Query the knowledge graph { "name": "search_nodes", "arguments": { "query": "San Francisco engineer" } } // Response { "content": [ { "type": "text", "text": "Found entities:\n- John_Smith (person): Software engineer, Lives in San Francisco\n\nRelations:\n- John_Smith works_at Acme_Corp" } ] } ``` ```typescript // Tool: add_observations - Add facts to existing entities { "name": "add_observations", "arguments": { "observations": [ { "entityName": "John_Smith", "contents": ["Prefers remote work", "Interested in machine learning"] } ] } } ``` ### Git MCP Server Git repository interaction and automation ```bash # Claude Desktop configuration (UV) { "mcpServers": { "git": { "command": "uvx", "args": ["mcp-server-git", "--repository", "/path/to/repo"] } } } ``` ```typescript // Tool: git_status - Check working tree status { "name": "git_status", "arguments": { "repo_path": "/path/to/repo" } } // Response { "content": [ { "type": "text", "text": "On branch main\nChanges not staged for commit:\n modified: src/index.ts\n modified: README.md\n\nUntracked files:\n new-feature.ts" } ] } ``` ```typescript // Tool: git_diff_staged - View staged changes { "name": "git_diff_staged", "arguments": { "repo_path": "/path/to/repo", "context_lines": 3 } } // Response { "content": [ { "type": "text", "text": "diff --git a/src/index.ts b/src/index.ts\nindex abc123..def456 100644\n--- a/src/index.ts\n+++ b/src/index.ts\n@@ -10,3 +10,4 @@\n function main() {\n console.log('Starting');\n+ loadConfig();\n }" } ] } ``` ```typescript // Tool: git_log - View commit history with date filtering { "name": "git_log", "arguments": { "repo_path": "/path/to/repo", "max_count": 5, "start_timestamp": "2024-01-01", "end_timestamp": "2024-01-31" } } // Response { "content": [ { "type": "text", "text": "abc123 - John Doe - 2024-01-15: Add feature X\ndef456 - Jane Smith - 2024-01-10: Fix bug in parser\n..." } ] } ``` ```typescript // Tool: git_commit - Create a commit { "name": "git_add", "arguments": { "repo_path": "/path/to/repo", "files": ["src/index.ts", "README.md"] } } { "name": "git_commit", "arguments": { "repo_path": "/path/to/repo", "message": "feat: add configuration loading\n\nImplemented config loader with validation" } } // Response { "content": [ { "type": "text", "text": "Created commit abc123def456" } ] } ``` ### Time MCP Server Time and timezone conversion capabilities ```bash # Claude Desktop configuration { "mcpServers": { "time": { "command": "uvx", "args": ["mcp-server-time", "--local-timezone=America/New_York"] } } } ``` ```typescript // Tool: get_current_time - Get current time in any timezone { "name": "get_current_time", "arguments": { "timezone": "Asia/Tokyo" } } // Response { "content": [ { "type": "text", "text": "{\"timezone\": \"Asia/Tokyo\", \"datetime\": \"2024-01-15T14:30:00+09:00\", \"is_dst\": false}" } ] } ``` ```typescript // Tool: convert_time - Convert between timezones { "name": "convert_time", "arguments": { "source_timezone": "America/New_York", "time": "16:30", "target_timezone": "Europe/London" } } // Response { "content": [ { "type": "text", "text": "{\n \"source\": {\"timezone\": \"America/New_York\", \"datetime\": \"2024-01-15T16:30:00-05:00\"},\n \"target\": {\"timezone\": \"Europe/London\", \"datetime\": \"2024-01-15T21:30:00+00:00\"},\n \"time_difference\": \"+5.0h\"\n}" } ] } ``` ### Sequential Thinking MCP Server Dynamic and reflective problem-solving through thought sequences ```bash # Claude Desktop configuration { "mcpServers": { "sequential-thinking": { "command": "npx", "args": ["-y", "@modelcontextprotocol/server-sequential-thinking"] } } } ``` ```typescript // Tool: sequential_thinking - Multi-step problem solving { "name": "sequential_thinking", "arguments": { "thought": "First, I need to understand the requirements: build a REST API with authentication", "nextThoughtNeeded": true, "thoughtNumber": 1, "totalThoughts": 5 } } // Next thought with revision { "name": "sequential_thinking", "arguments": { "thought": "Actually, I should start by designing the database schema first, as it will inform the API structure", "nextThoughtNeeded": true, "thoughtNumber": 2, "totalThoughts": 6, "isRevision": true, "revisesThought": 1 } } // Branching thought path { "name": "sequential_thinking", "arguments": { "thought": "Alternative approach: Use a NoSQL database instead of SQL", "nextThoughtNeeded": true, "thoughtNumber": 3, "totalThoughts": 7, "branchFromThought": 2, "branchId": "nosql-alternative" } } ``` ### Everything MCP Server Reference server demonstrating all MCP protocol features ```bash # Claude Desktop configuration { "mcpServers": { "everything": { "command": "npx", "args": ["-y", "@modelcontextprotocol/server-everything"] } } } ``` ```typescript // Tool: echo - Simple echo demonstration { "name": "echo", "arguments": { "message": "Hello MCP" } } // Tool: longRunningOperation - Progress notifications demo { "name": "longRunningOperation", "arguments": { "duration": 10, "steps": 5 } } // Server sends progress notifications during execution: // Progress: 20% complete... // Progress: 40% complete... // Progress: 60% complete... ``` ```typescript // Tool: sampleLLM - LLM sampling capability { "name": "sampleLLM", "arguments": { "prompt": "Write a haiku about programming", "maxTokens": 50 } } // Response { "content": [ { "type": "text", "text": "Code flows like water\nBugs hide in silent branches\nDebugger reveals" } ] } ``` ```typescript // Resource: Access test resources (100 available) // Even-numbered resources return plaintext // URI: test://static/resource/2 { "uri": "test://static/resource/2", "mimeType": "text/plain", "text": "This is test resource #2" } // Odd-numbered resources return binary blobs // URI: test://static/resource/3 { "uri": "test://static/resource/3", "mimeType": "application/octet-stream", "blob": "base64encodeddata..." } ``` ```typescript // Prompt: complex_prompt - Multi-turn conversation { "name": "complex_prompt", "arguments": { "temperature": "0.7", "style": "concise" } } // Returns structured prompt messages { "messages": [ { "role": "user", "content": { "type": "text", "text": "You are a helpful assistant. Temperature: 0.7, Style: concise" } } ] } ``` ## Integration Patterns and Use Cases MCP servers enable AI assistants to interact with external systems through a standardized protocol, making LLMs more capable and context-aware. The reference servers in this repository demonstrate key integration patterns: secure filesystem access with granular permissions, persistent memory through knowledge graphs, web content ingestion with automatic format conversion, version control operations, and specialized utilities like timezone handling. Each server showcases different MCP capabilities—tools for actions, resources for data access, prompts for interaction templates, and advanced features like progress notifications and sampling. Developers can use these servers as building blocks for their own applications or as templates for creating custom MCP servers. Common use cases include: giving AI coding assistants access to project files and git operations, enabling chatbots to remember user preferences and relationships over time, allowing AI to fetch and analyze web content for research tasks, providing timezone-aware scheduling capabilities, and supporting complex multi-step reasoning workflows. The modular design allows servers to be mixed and matched, creating rich AI experiences that combine multiple data sources and capabilities while maintaining security through controlled access patterns.