# MCP Servers in TypeScript (SDK v2)

`mcp/typescript-server` · Skill · v1.0.0

Build, test and port MCP servers on the v2 TypeScript SDK and the 2026-07-28 protocol, without the v1-era mistakes agents usually make.

Current, verified guidance for Model Context Protocol servers written with the official TypeScript SDK v2 (@modelcontextprotocol/server 2.x, zod 4). It covers tool registration and schemas, structured output that passes the SDK's own validation, choosing between isError results and protocol errors, resource templates that actually list, prompts, progress and cancellation through ctx.mcpReq, serving both protocol eras with serveStdio or createMcpHandler, stdout hygiene on stdio, and a symptom-driven map for porting @modelcontextprotocol/sdk 1.x code. Each claim was checked against the installed 2.4.0 packages and the 2026-07-28 specification.

## Verdict

- level: **submitted** — In the catalog, not yet checked for this digest.
- uplift: **untested** — No runs exist for this digest.
- digest: `sha256:ed7e852bc97dfcc567810803d706d5657d667fe818c9bb6aeb786081da4b945c`

## Uplift runs

None for this digest. Untested is not the same as useless: nobody has measured it yet.

## Security

No checks recorded for this digest.

## Compatibility

| agent | targeted | compiled | evaluated |
| --- | --- | --- | --- |
| Claude Code | yes | no record | no record |
| Codex | yes | no record | no record |
| Cursor | yes | no record | no record |
| GitHub Copilot | yes | no record | no record |
| Gemini CLI | yes | no record | no record |
| OpenCode | yes | no record | no record |

## Permissions

- network: none
- shell: node, npm test, npm run typecheck, npx tsc
- filesystem: write
- env: none

## Files

- `SKILL.md` 17067 B sha256:689b77856585206fdcd2e1c2ade55729442a26f3b7c7a8185373eda278590e08
- `references/http-and-eras.md` 5715 B sha256:a963576d7769bd2e493dc1fc207d9f3bd1eb29ae1b71e64e828a404d7a4ed279
- `references/sources.md` 2925 B sha256:d8586fbe893dcdd58e85ca988eac1e6b3c528c36abb24f7ec2a1d2922e5c304e
- `references/testing.md` 6099 B sha256:c5eba7a997c62e580d2923b8e08fbaa79a9ce27aac9bcf5972e89441520b0be8
- `references/v1-to-v2.md` 6565 B sha256:17065ccf35cc625ed22cae395d5e1a719a5d988d3d2773ac7c33fc8efb634b33

## Limitations

- Written for @modelcontextprotocol/server 2.4.x and protocol revision 2026-07-28; later 2.x releases may rename or add APIs.
- Covers TypeScript servers. Client and host development, OAuth authorization servers and the Python SDK are only touched where a server needs them.
- Streamable HTTP guidance is lighter than stdio and was checked with node:http only, not every framework adapter.
- Multi-round-trip input (inputRequired), subscriptions and tasks are named but not taught in depth.
- The proof suite exercises stdio servers only; HTTP deployment advice is not measured by it.

## Install

```sh
npx sigil add mcp/typescript-server --agent claude-code,codex,cursor
```

Source: https://github.com/dgesteves/sigil/tree/5cb851d5b2f2f14446ddf631ef5e91bf9d3263dd/catalog/skills/mcp/typescript-server