{"id":30870368,"url":"https://github.com/cycle-sync-ai/getting-started-with-mcp-server","last_synced_at":"2026-05-28T04:31:43.223Z","repository":{"id":290992628,"uuid":"976213376","full_name":"cycle-sync-ai/getting-started-with-mcp-server","owner":"cycle-sync-ai","description":"This tutorial walks you through setting up a basic MCP (Model Context Protocol) server to expose read-only resources to Large Language Models (LLMs) like Claude. ","archived":false,"fork":false,"pushed_at":"2025-05-01T19:21:32.000Z","size":23,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-09-07T22:31:52.393Z","etag":null,"topics":["agent","ai","mcp","model-context-protocol","model-context-protocol-server"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cycle-sync-ai.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-05-01T17:48:32.000Z","updated_at":"2025-05-01T19:23:23.000Z","dependencies_parsed_at":"2025-05-01T19:48:35.132Z","dependency_job_id":null,"html_url":"https://github.com/cycle-sync-ai/getting-started-with-mcp-server","commit_stats":null,"previous_names":["cycle-sync-ai/getting-started-with-mcp-server"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/cycle-sync-ai/getting-started-with-mcp-server","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cycle-sync-ai%2Fgetting-started-with-mcp-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cycle-sync-ai%2Fgetting-started-with-mcp-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cycle-sync-ai%2Fgetting-started-with-mcp-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cycle-sync-ai%2Fgetting-started-with-mcp-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cycle-sync-ai","download_url":"https://codeload.github.com/cycle-sync-ai/getting-started-with-mcp-server/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cycle-sync-ai%2Fgetting-started-with-mcp-server/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33594851,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-28T02:00:06.440Z","response_time":99,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["agent","ai","mcp","model-context-protocol","model-context-protocol-server"],"created_at":"2025-09-07T22:04:38.440Z","updated_at":"2026-05-28T04:31:43.196Z","avatar_url":"https://github.com/cycle-sync-ai.png","language":"TypeScript","funding_links":[],"categories":["🤖 AI/ML"],"sub_categories":[],"readme":"# Building MCP Servers: Part 1 — Getting Started with Resources\n\nThis tutorial walks you through setting up a basic MCP (Model Context Protocol) server to expose read-only resources to Large Language Models (LLMs) like Claude. You’ll learn what MCP is, why resources are useful, and how to initialize a Node.js/TypeScript project with the `@modelcontextprotocol/sdk`.\n\n## Table of Contents\n\n- [What is Model Context Protocol?](#what-is-model-context-protocol)\n- [What are MCP Resources?](#what-are-mcp-resources)\n- [Why Use Resources?](#why-use-resources)\n- [Example Servers](#example-servers)\n  - [Documentation Server](#documentation-server)\n  - [Log Analysis Server](#log-analysis-server)\n  - [Customer Data Server](#customer-data-server)\n- [Getting Started](#getting-started)\n  - [Prerequisites](#prerequisites)\n  - [Installation](#installation)\n  - [Project Setup](#project-setup)\n- [Next Steps](#next-steps)\n- [MCP Tools (Dynamic Actions)](#mcp-tools-dynamic-actions)\n- [Tools vs Prompts](#tools-vs-prompts)\n- [Complete Our Greeting Server](#complete-our-greeting-server)\n- [Sources \u0026 Additional Reading](#sources--additional-reading)\n- [License](#license)\n\n## What is Model Context Protocol?\n\nThe Model Context Protocol (MCP) is a standardized interface that allows LLMs to safely interact with external data and services. With MCP, you can expose files, databases, APIs, and more to your AI models in a controlled manner.\n\n## What are MCP Resources?\n\nResources are read-only endpoints that expose content (text or binary) via a unique URI. Examples include:\n\n- `file:///path/to/file.txt`\n- `database://users/123`\n- `api://weather/latest`\n\nEach resource has metadata like a display name and MIME type.\n\n## Why Use Resources?\n\nResources enable LLMs to:\n\n- Read files and databases\n- Execute commands\n- Access APIs\n- Interact with local tools\n\nAll interactions require explicit user permission, ensuring security and auditability.\n\n## Example Servers\n\n### Documentation Server\n\nExpose your documentation:\n\n```txt\ndocs://api/reference     → API documentation\ndocs://guides/getting-started  → User guides\n```\n\n### Log Analysis Server\n\nServe system logs:\n\n```txt\nlogs://system/today      → Today's logs\nlogs://errors/recent     → Recent error messages\n```\n\n### Customer Data Server\n\nProvide customer insights:\n\n```txt\ncustomers://profiles/summary   → Customer overview\ncustomers://feedback/recent    → Latest feedback\n```\n\n## Getting Started\n\n### Prerequisites\n\n- Node.js (\u003e= 16)\n- npm (\u003e= 8)\n- TypeScript\n\n### Installation\n\n```bash\nmkdir hello-mcp\ncd hello-mcp\nnpm init -y\nnpm install @modelcontextprotocol/sdk\nnpm install -D typescript @types/node\n```\n\n### Project Setup\n\n1. Update `package.json`:\n\n   ```json\n   {\n     \"name\": \"hello-mcp\",\n     \"version\": \"1.0.0\",\n     \"type\": \"module\",\n     \"scripts\": {\n       \"build\": \"tsc\",\n       \"test\": \"echo \\\"Error: no test specified\\\" \u0026\u0026 exit 1\"\n     },\n     \"dependencies\": {\n       \"@modelcontextprotocol/sdk\": \"^1.1.0\"\n     },\n     \"devDependencies\": {\n       \"typescript\": \"^5.7.2\",\n       \"@types/node\": \"^22.10.5\"\n     }\n   }\n   ```\n\n2. Create `tsconfig.json`:\n\n   ```json\n   {\n     \"compilerOptions\": {\n       \"target\": \"ES2022\",\n       \"module\": \"Node16\",\n       \"moduleResolution\": \"Node16\",\n       \"outDir\": \"./build\",\n       \"rootDir\": \"./src\",\n       \"strict\": true,\n       \"esModuleInterop\": true,\n       \"skipLibCheck\": true,\n       \"forceConsistentCasingInFileNames\": true\n     },\n     \"include\": [\"src/**/*\"]\n   }\n   ```\n\n3. Create a `src/` directory and start coding your MCP server.\n\n## Next Steps\n\nCheck out Part 2 for configuring transports and advanced features.\n\n## MCP Tools (Dynamic Actions)\n\nMCP Tools (also called dynamic actions) let you define custom functions that the LLM can call during a session, extending MCP’s capabilities beyond static resources.\n\n## Tools vs Prompts\n\n| Aspect      | MCP Tools               | Prompts                 |\n| ----------- | ----------------------- | ----------------------- |\n| Capability  | Executes code \u0026 actions | Static natural language |\n| Security    | Controlled \u0026 auditable  | No external effects     |\n| Flexibility | High (custom logic)     | Limited to inference    |\n\n## Complete Our Greeting Server\n\nBelow is a simple example of a greeting server exposing a greeting resource:\n\n```ts\nimport { ResourceServer } from \"@modelcontextprotocol/sdk\";\n\nconst server = new ResourceServer({ port: 3000 });\n\nserver.addResource({\n  uri: \"greeting://hello\",\n  displayName: \"Greeting Resource\",\n  fn: async (req) =\u003e {\n    const name = req.query.name || \"World\";\n    return `Hello, ${name}!`;\n  },\n});\n\nserver.listen(() =\u003e console.log(\"Greeting server running on port 3000\"));\n```\n\n## Sources \u0026 Additional Reading\n\n- [MCP Prompts](https://modelcontextprotocol.io/docs/concepts/prompts)\n- [unichat-mcp-server](https://github.com/amidabuddha/unichat-mcp-server)\n- [Claude Prompt Engineering](https://docs.anthropic.com/en/docs/build-with-claude/prompt-engineering/overview)\n- [10 Prompt Engineering Best Practices](https://dev.to/get_pieces/10-prompt-engineering-best-practices-23dk)\n- [Prompting Guide](https://promptingguide.ai)\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcycle-sync-ai%2Fgetting-started-with-mcp-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcycle-sync-ai%2Fgetting-started-with-mcp-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcycle-sync-ai%2Fgetting-started-with-mcp-server/lists"}