mcp-ts-template 2.0.2 → 2.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +37 -24
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
<div align="center">
|
|
2
|
-
<
|
|
3
|
-
<
|
|
4
|
-
<br />
|
|
5
|
-
<h1>Model Context Protocol (MCP) TypeScript Server Template</h1>
|
|
6
|
-
<p><b>The definitive, production-grade template for building powerful and scalable Model Context Protocol servers with TypeScript, featuring built-in observability (OpenTelemetry), declarative tooling, robust error handling, and a modular, DI-driven architecture.</b></p>
|
|
2
|
+
<h1>mcp-ts-template</h1>
|
|
3
|
+
<p><b>The definitive, production-grade template for building powerful and scalable Model Context Protocol (MCP) servers with TypeScript, featuring built-in observability (OpenTelemetry), declarative tooling, robust error handling, and a modular, DI-driven architecture.</b></p>
|
|
7
4
|
|
|
8
|
-
[](./CHANGELOG.md) [](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/main/docs/specification/2025-06-18/changelog.mdx) [](https://modelcontextprotocol.io/) [](./LICENSE) [](https://github.com/cyanheads/mcp-ts-template/issues) [](https://www.typescriptlang.org/) [](https://bun.sh/) [](./coverage/lcov-report/)
|
|
9
6
|
|
|
10
7
|
</div>
|
|
11
8
|
|
|
@@ -56,7 +53,6 @@ This template is packed with production-grade features designed for high-perform
|
|
|
56
53
|
```
|
|
57
54
|
|
|
58
55
|
3. **Build the Project**
|
|
59
|
-
|
|
60
56
|
```bash
|
|
61
57
|
bun build # or bun rebuild
|
|
62
58
|
```
|
|
@@ -196,16 +192,16 @@ Refer to **`.env.example`** for a complete list of configurable options.
|
|
|
196
192
|
|
|
197
193
|
Key scripts available in `package.json`:
|
|
198
194
|
|
|
199
|
-
| Script
|
|
200
|
-
|
|
|
201
|
-
| `bun run devdocs`
|
|
202
|
-
| `bun run rebuild`
|
|
203
|
-
| `bun run start:http`
|
|
204
|
-
| `bun run start:stdio`
|
|
205
|
-
| `bun run test`
|
|
206
|
-
| `bun run test:coverage`
|
|
207
|
-
| `bun run devcheck`
|
|
208
|
-
| `bun run
|
|
195
|
+
| Script | Description |
|
|
196
|
+
| :---------------------- | :------------------------------------------------------------------------------------------------------------- |
|
|
197
|
+
| `bun run devdocs` | Generates a comprehensive development documentation prompt for AI analysis. |
|
|
198
|
+
| `bun run rebuild` | Clears logs, cache, and compiles the TypeScript source code to JavaScript in `dist/`. |
|
|
199
|
+
| `bun run start:http` | Starts the compiled server using the HTTP transport. |
|
|
200
|
+
| `bun run start:stdio` | Starts the compiled server using the STDIO transport. |
|
|
201
|
+
| `bun run test` | Runs all unit and integration tests with Vitest. |
|
|
202
|
+
| `bun run test:coverage` | Runs all tests and generates a code coverage report. |
|
|
203
|
+
| `bun run devcheck` | A comprehensive script that runs linting, type-checking, and formatting. |
|
|
204
|
+
| `bun run publish-mcp` | **(Recommended)** An all-in-one script to sync, validate, commit, and publish your server to the MCP Registry. |
|
|
209
205
|
|
|
210
206
|
You can find these scripts in the `scripts/` directory.
|
|
211
207
|
|
|
@@ -213,20 +209,37 @@ You can find these scripts in the `scripts/` directory.
|
|
|
213
209
|
|
|
214
210
|
## 📦 Publishing to the MCP Registry
|
|
215
211
|
|
|
216
|
-
This template is configured for easy publishing to the public [MCP Registry](https://modelcontext.com/registry), making your server discoverable by any MCP-compatible client.
|
|
212
|
+
This template is configured for easy publishing to the public [MCP Registry](https://modelcontext.com/registry), making your server discoverable by any MCP-compatible client. The recommended method is to use the all-in-one publishing script.
|
|
217
213
|
|
|
218
|
-
For a complete walkthrough, including
|
|
214
|
+
For a complete walkthrough, including alternative methods and CI/CD automation, please refer to the detailed guide:
|
|
219
215
|
|
|
220
216
|
**[➡️ How to Publish Your MCP Server](./docs/publishing-mcp-server-registry.md)**
|
|
221
217
|
|
|
222
|
-
###
|
|
218
|
+
### The Easy Way: All-in-One Publish Script
|
|
219
|
+
|
|
220
|
+
This template includes a powerful script that automates the entire publishing workflow—from syncing versions and validating schemas to committing changes and publishing.
|
|
223
221
|
|
|
224
|
-
1. **
|
|
225
|
-
2. **
|
|
222
|
+
1. **Ensure you are on the `main` branch with no uncommitted changes.**
|
|
223
|
+
2. **Run the script:**
|
|
226
224
|
```bash
|
|
227
|
-
bun run
|
|
225
|
+
bun run publish-mcp
|
|
228
226
|
```
|
|
229
|
-
|
|
227
|
+
|
|
228
|
+
The script will guide you through the process, including pausing for you to complete the GitHub browser login.
|
|
229
|
+
|
|
230
|
+
### Script Flags for More Control
|
|
231
|
+
|
|
232
|
+
The script also supports flags for more granular control:
|
|
233
|
+
|
|
234
|
+
- `--validate-only`: Syncs metadata, validates `server.json`, then stops.
|
|
235
|
+
- `--no-commit`: Skips the automatic Git commit step.
|
|
236
|
+
- `--publish-only`: Skips local file changes and proceeds directly to publishing.
|
|
237
|
+
|
|
238
|
+
Example:
|
|
239
|
+
|
|
240
|
+
```bash
|
|
241
|
+
bun run publish-mcp --validate-only
|
|
242
|
+
```
|
|
230
243
|
|
|
231
244
|
This template also includes a GitHub Actions workflow (`.github/workflows/publish-mcp.yml`) that can be configured to automate this process whenever you push a new Git tag.
|
|
232
245
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mcp-ts-template",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.3",
|
|
4
4
|
"mcpName": "io.github.cyanheads/mcp-ts-template",
|
|
5
5
|
"description": "The definitive, production-grade template for building powerful and scalable Model Context Protocol (MCP) servers with TypeScript, featuring built-in observability (OpenTelemetry), declarative tooling, robust error handling, and a modular, DI-driven architecture.",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
"test:integration": "INTEGRATION=1 bun test tests/integration",
|
|
59
59
|
"audit": "bun audit",
|
|
60
60
|
"audit:fix": "bun audit --fix",
|
|
61
|
-
"
|
|
61
|
+
"publish-mcp": "bun scripts/validate-mcp-publish-schema.ts"
|
|
62
62
|
},
|
|
63
63
|
"resolutions": {
|
|
64
64
|
"@hono/node-server": "1.19.2",
|
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
"@modelcontextprotocol/sdk": "^1.18.0",
|
|
74
74
|
"@opentelemetry/instrumentation-winston": "^0.50.0",
|
|
75
75
|
"@supabase/supabase-js": "^2.57.4",
|
|
76
|
-
"axios": "^1.12.
|
|
76
|
+
"axios": "^1.12.2",
|
|
77
77
|
"chrono-node": "^2.8.4",
|
|
78
78
|
"dotenv": "^16.6.1",
|
|
79
79
|
"hono": "^4.9.7",
|
|
@@ -104,7 +104,7 @@
|
|
|
104
104
|
"@opentelemetry/sdk-trace-node": "^2.1.0",
|
|
105
105
|
"@opentelemetry/semantic-conventions": "^1.37.0",
|
|
106
106
|
"@types/js-yaml": "^4.0.9",
|
|
107
|
-
"@types/node": "^24.
|
|
107
|
+
"@types/node": "^24.4.0",
|
|
108
108
|
"@types/node-cron": "^3.0.11",
|
|
109
109
|
"@types/sanitize-html": "^2.16.0",
|
|
110
110
|
"@types/validator": "13.15.3",
|
|
@@ -121,7 +121,7 @@
|
|
|
121
121
|
"msw": "^2.11.2",
|
|
122
122
|
"prettier": "^3.6.2",
|
|
123
123
|
"tsx": "^4.20.5",
|
|
124
|
-
"typedoc": "^0.28.
|
|
124
|
+
"typedoc": "^0.28.13",
|
|
125
125
|
"typescript": "^5.9.2",
|
|
126
126
|
"typescript-eslint": "8.43.0",
|
|
127
127
|
"vite": "^7.1.5",
|