RepoPilot

modelcontextprotocol / typescript-sdk

Search modelcontextprotocol/typescript-sdk

GitHub

Code

How modelcontextprotocol/typescript-sdk is laid out, and where to start for common changes.

B
Architecture grade
score 74/100
5
Import cycles
lower is better
317
Files mapped
506 imports between them
96%
Layering
of imports point one way

From the map of which files import which, built when the code was last read in full. It shows what depends on what, not a reading order.

Module map

Shade by
Entry points and orchestratorsFoundationStandaloneserver50 files · 29 commitsclient37 files · 32 commitsmiddleware37 files · 13 commitsserver-legacy21 files · 9 commitscore14 files · 10 commitscore-internal77 files · 25 commitscodemod34 files · 9 commits

7 modules, 5 links. A link means one module imports another; thicker lines mean more imports. Links come from 317 of 431 source files, so the real counts are higher. Select a module to trace it: blue lines go to what it uses, orange lines come from what uses it.

server501029Foundation
client371032Foundation
middleware371013Foundation
server-legacy21109Foundation
core141010Foundation
core-internal770025Standalone
codemod34059Entry or leaf

Where to start reading

  1. Repository root
  2. Repository root
  3. Likely public API
  4. Likely public API
  5. Likely start-up file
  6. Likely start-up file
  7. Suggested starting pointAI
  8. Suggested starting pointAI

Find files for a task

AI

Add a new protocol message type

  • Define the message type interface in core types
  • Add codec serialization/deserialization in wire module
  • Implement handler in client-side message routing
  • Implement handler in server-side message routing

Add a new client capability or skill

  • Define capability interface in core skills
  • Implement client-side skill handler
  • Add validation schema if needed

Add a new authentication handler

  • Create auth handler definition in core auth types
  • Implement shared auth utilities if cross-cutting
  • Wire handler into client authentication seam
  • Add server-side auth validation

Support a new validator/environment (e.g., edge runtime)

  • Create environment-specific validator provider
  • Add shims for target environment if needed
  • Register validator in core-internal exports

Change the public API

Trace runtime behavior

Add or update tests

Change build or automation

RepoPilot lists up to 500 files, so a file missing here may still exist.

  • Files marked “likely” are guessed from their names.

Code quality and hotspots

Largest source files

  • Branch points121 per file on average
  • Code issues0 errors, 69 warnings
  • Largest file3,173 lines
  • Hotspot load8 high-risk files

Static checks on the 15 largest source files.

Tests, CI and tooling

  • CIGitHub Actions7 workflows
  • Tests546 test filesJest/Vitest · 1.3 test files per source file (file count, not coverage)
  • Dependency updatesDependabot

Test folders: packages/client/test/client · examples/cli-client/test · examples/shared/test

Hotspots

Files that change often and branch heavily, highest first. Branch points count if, loop, case, catch, ternary, && and || in the file.