{"id":27999171,"url":"https://github.com/bsmi021/custom-mcp-template","last_synced_at":"2026-05-02T05:10:14.784Z","repository":{"id":284936045,"uuid":"956542502","full_name":"bsmi021/custom-mcp-template","owner":"bsmi021","description":"This template helps you quickly bootstrap a new Model Context Protocol (MCP) server project based on recommended practices.","archived":false,"fork":false,"pushed_at":"2025-04-03T21:35:22.000Z","size":74,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-24T00:36:06.403Z","etag":null,"topics":["claude","cursor","mcp","mcpserver","template"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/mcp-server-template","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/bsmi021.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"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,"zenodo":null}},"created_at":"2025-03-28T12:35:10.000Z","updated_at":"2025-04-03T21:35:25.000Z","dependencies_parsed_at":"2025-03-28T13:39:41.983Z","dependency_job_id":"becaa715-7ae8-4b75-96f0-f24d72078dbb","html_url":"https://github.com/bsmi021/custom-mcp-template","commit_stats":null,"previous_names":["bsmi021/custom-mcp-template"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/bsmi021/custom-mcp-template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bsmi021%2Fcustom-mcp-template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bsmi021%2Fcustom-mcp-template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bsmi021%2Fcustom-mcp-template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bsmi021%2Fcustom-mcp-template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bsmi021","download_url":"https://codeload.github.com/bsmi021/custom-mcp-template/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bsmi021%2Fcustom-mcp-template/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32523518,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-02T01:12:54.858Z","status":"online","status_checked_at":"2026-05-02T02:00:05.923Z","response_time":132,"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":["claude","cursor","mcp","mcpserver","template"],"created_at":"2025-05-08T22:56:48.446Z","updated_at":"2026-05-02T05:10:14.770Z","avatar_url":"https://github.com/bsmi021.png","language":"TypeScript","funding_links":[],"categories":["🌐 Web Development"],"sub_categories":[],"readme":"﻿# MCP Server Template (`create-mcp-server`)\n\nThis template helps you quickly bootstrap a new Model Context Protocol (MCP) server project based on recommended practices.\n\n## Usage (Creating a New Server)\n\nTo create a new MCP server project named `my-new-mcp-server`, run the following command using `npx`:\n\n```bash\nnpx create-mcp-server my-new-mcp-server\n```\n\n*(Note: If you haven't published this package to npm, you might need to run `npm link` in this template directory first, then use `create-mcp-server my-new-mcp-server`)*\n\nThis will:\n\n1. Create a new directory named `my-new-mcp-server`.\n2. Prompt you for project details (name, description).\n3. Copy the template files (`src`, `docs`, config files, etc.) into the new directory.\n4. Update the `package.json` with your project details.\n\nAfter initialization, follow the instructions provided in the terminal:\n\n```bash\ncd my-new-mcp-server\nnpm install\n# Review configuration in src/config/ConfigurationManager.ts\n# Add your tools in src/tools/\n# Add your services in src/services/\nnpm run dev  # Start the development server\n```\n\n---\n\n## Developing This Template (Advanced)\n\nThis section describes the structure and development process for the `mcp-server-template` *itself*. You typically don't need this if you are just using the template to create your own server.\n\n### Project Structure\n\n- /src: Contains all source code.\n  - /config: Configuration management (ConfigurationManager).\n  - /services: Core business logic classes.\n  - /tools: MCP tool definitions and adapters (*Tool.ts,*Params.ts).\n  - /types: TypeScript interfaces and Zod schemas.\n  - /utils: Shared utility functions (logging, errors, etc.).\n  - initialize.ts: Server instance creation and tool registration.\n  - server.ts: Main application entry point.\n- /dist: Compiled JavaScript output (generated by\npm run build).\n- package.json: Project metadata and dependencies.\n-    sconfig.json: TypeScript compiler options.\n- .eslintrc.json: ESLint configuration.\n- .prettierrc.json: Prettier configuration.\n- .gitignore: Git ignore rules.\n\n## Getting Started\n\n1. **Install Dependencies:**\n    `\bash\n    npm install\n    `\n2. **Configure Husky (if needed, first time):**\n    `\bash\n    npx husky install\n    `\n3. **Run in Development Mode:** (Uses  s-node and\nodemon for auto-reloading)\n    `\bash\n    npm run dev\n    `\n4. **Build for Production:**\n    `\bash\n    npm run build\n    `\n5. **Run Production Build:**\n    `\bash\n    npm start\n    `\n\n## Adding a New Tool (yourTool)\n\n1. **Define Types:** Create src/types/yourServiceTypes.ts with interfaces (e.g., YourServiceConfig, YourServiceData). Export from src/types/index.ts.\n2. **Implement Service:** Create src/services/YourService.ts with the core logic class. Export from src/services/index.ts.\n3. **Define Tool Params:** Create src/tools/yourToolParams.ts with TOOL_NAME, TOOL_DESCRIPTION, and TOOL_PARAMS (using Zod with detailed .describe() calls).\n4. **Implement Tool Registration:** Create src/tools/yourTool.ts. Import the service and params. Create a function that instantiates the service and calls server.tool() with an async handler that validates input, calls the service, formats output, and handles errors (mapping to McpError).\n5. **Register the Tool:** Import and call the registration function from src/tools/index.ts within the\negisterTools function.\n6. **Add Configuration:** If needed, update src/config/ConfigurationManager.ts to include config types, defaults, getters, and updaters for the new service.\n7. **Add Utilities:** If needed, add helper functions to src/utils/ and export them.\n8. **Write Tests:** Add unit tests for the service logic in src/services/ and potentially integration tests for the tool adapter in src/tools/.\n\n## Linting and Formatting\n\n- **Lint:**\npm run lint\n- **Format:**\npm run format\n\nCode will be automatically linted and formatted on commit via Husky and lint-staged.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbsmi021%2Fcustom-mcp-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbsmi021%2Fcustom-mcp-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbsmi021%2Fcustom-mcp-template/lists"}