{"id":26704939,"url":"https://github.com/rethunk-tech/mcp-template-node","last_synced_at":"2025-06-24T13:11:48.890Z","repository":{"id":284617649,"uuid":"955519479","full_name":"Rethunk-Tech/mcp-template-node","owner":"Rethunk-Tech","description":"A template repository for creating Model Context Protocol (MCP) servers in Node.js/TypeScript. This template demonstrates how to build a simple notes management system using the MCP protocol, which can be used with LLM-powered applications.","archived":false,"fork":false,"pushed_at":"2025-03-26T19:25:47.000Z","size":1088,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-26T20:26:18.602Z","etag":null,"topics":["llm","llm-tools","mcp","mcp-server","modelcontextprotocol","nodejs","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Rethunk-Tech.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","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}},"created_at":"2025-03-26T19:09:06.000Z","updated_at":"2025-03-26T19:25:50.000Z","dependencies_parsed_at":"2025-03-26T20:37:14.620Z","dependency_job_id":null,"html_url":"https://github.com/Rethunk-Tech/mcp-template-node","commit_stats":null,"previous_names":["rethunk-tech/mcp-template-node"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Rethunk-Tech/mcp-template-node","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rethunk-Tech%2Fmcp-template-node","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rethunk-Tech%2Fmcp-template-node/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rethunk-Tech%2Fmcp-template-node/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rethunk-Tech%2Fmcp-template-node/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Rethunk-Tech","download_url":"https://codeload.github.com/Rethunk-Tech/mcp-template-node/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rethunk-Tech%2Fmcp-template-node/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261682995,"owners_count":23193686,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["llm","llm-tools","mcp","mcp-server","modelcontextprotocol","nodejs","typescript"],"created_at":"2025-03-27T05:19:32.840Z","updated_at":"2025-06-24T13:11:48.875Z","avatar_url":"https://github.com/Rethunk-Tech.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MCP Template Node\n\nA template repository for creating Model Context Protocol (MCP) servers in Node.js/TypeScript. This template demonstrates a simple notes management system using the MCP protocol.\n\n## What is MCP?\n\nThe Model Context Protocol (MCP) is a standardized way for applications to provide context to Large Language Models (LLMs). Learn more at the [Model Context Protocol Website](https://modelcontextprotocol.github.io/).\n\n## Features\n\n- TypeScript implementation with strict type checking\n- Simple notes management system with basic CRUD operations\n- Complete examples of MCP concepts (Tools, Resources, Prompts)\n- In-memory storage for notes\n- Comprehensive error handling and validation\n- Unit tests with Vitest\n- VS Code debugging configuration\n- GitHub Actions CI workflow for testing and building\n\n## Prerequisites\n\n- Node.js 18 or later\n- npm or yarn\n\n## Project Structure\n\n```shell\nmcp-template-node/\n├── build/                # Compiled JavaScript files\n├── src/\n│   ├── __tests__/        # Integration tests and test utilities\n│   ├── errors/           # Custom error classes\n│   ├── tools/            # MCP tool implementations\n│   │   └── __tests__/    # Tool unit tests\n│   ├── types/            # TypeScript type definitions\n│   │   └── __tests__/    # Type tests\n│   └── index.ts          # Main server entry point with MCP examples\n├── package.json          # Project configuration\n├── tsconfig.json         # TypeScript configuration\n├── eslint.config.mjs     # ESLint flat configuration\n└── README.md             # Project documentation\n```\n\n## Getting Started\n\n1. Clone the repository:\n\n   ```bash\n   git clone https://github.com/Rethunk-Tech/mcp-template-node.git\n   cd mcp-template-node\n   ```\n\n2. Install dependencies:\n\n   ```bash\n   yarn install\n   ```\n\n3. Build and run the server:\n\n   ```bash\n   yarn build\n   yarn start\n   ```\n\n## Development\n\n- Start TypeScript compiler in watch mode: `yarn dev`\n- Lint your code: `yarn lint`\n- Fix linting issues: `yarn lint:fix`\n- Run tests: `yarn test`\n\n## Testing\n\nThis project includes comprehensive tests to verify the functionality of the MCP server and its tools.\n\n### Running Tests\n\nRun all tests:\n\n```bash\nyarn test\n```\n\nRun tests in watch mode (rerun tests when files change):\n\n```bash\nyarn test:watch\n```\n\nRun tests with coverage:\n\n```bash\nyarn test:coverage\n```\n\n### Test Structure\n\n- **Unit Tests**: Located in `__tests__` directories near the code they test\n- **Integration Tests**: Located in `src/__tests__/`\n- **Test Utilities**: Common test helpers in `src/__tests__/test-utils.ts`\n\n### Writing Tests\n\nThe project includes a MockMcpServer for testing tools without real MCP dependencies:\n\n```typescript\nimport { MockMcpServer } from '../__tests__/test-utils.js';\n\ndescribe('My Tool Tests', () =\u003e {\n  let server: MockMcpServer;\n\n  beforeEach(() =\u003e {\n    server = new MockMcpServer();\n    // Register tools\n    registerMyTools(server as any);\n  });\n\n  it('should perform some action', async () =\u003e {\n    const result = await server.callTool('my_tool', { param: 'value' });\n    expect(result.content[0].text).toContain('Expected text');\n  });\n});\n```\n\n## Testing with MCP Inspector\n\nFor standalone testing, use the MCP Inspector tool:\n\n```bash\nyarn inspector\n```\n\nThis will open an interactive session where you can test your MCP tools.\n\n## Available Tools\n\n### Create Note\n\nCreates a new note with title and content.\n\n### List Notes\n\nLists all available notes with their IDs and titles.\n\n### Get Note\n\nRetrieves a specific note by ID.\n\n### Update Note\n\nUpdates an existing note's title, content, or tags.\n\n### Delete Note\n\nDeletes a note by ID.\n\n## Extending the Template\n\nTo extend this template:\n\n1. Add new types in `src/types/`\n2. Implement new tools in `src/tools/`\n3. Add new resources in `src/index.ts`\n4. Create new prompt templates as needed\n5. Add tests for your new functionality\n\n## Contributing\n\nSee [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines on how to contribute to this project.\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frethunk-tech%2Fmcp-template-node","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frethunk-tech%2Fmcp-template-node","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frethunk-tech%2Fmcp-template-node/lists"}