TypeMCP is an open-source TypeScript repository for one public, scoped decorator-first MCP server package: @theorvane/type-mcp. The root export provides the framework-neutral metadata/core API; @theorvane/type-mcp/http is its Fetch/Streamable HTTP subpath; @theorvane/type-mcp/langchain converts decorated tools to LangChain structured tools. The runtime core remains independent of agent and application frameworks.
- User request and approved product decisions
docs/product/anddocs/architecture/docs/planning/for executable task order and acceptance criteria- This file for repository operating rules
- Package README/API documentation
If sources conflict, stop and update the lower-priority document before implementation. Never silently implement against stale documentation.
src/: decorators, metadata, validation/compiler, resolver contract, and stdio helper. No application-framework imports.src/langchain.ts: tools-only LangChain adapter subpath. It may import@langchain/core, but never LangGraph or application framework packages.src/http.ts: FetchRequest → ResponseStreamable HTTP subpath entry point. It may depend on root runtime contracts but not the reverse.examples/: runnable, minimal usage—not a second framework implementation.docs/: canonical human-facing product, architecture, API, guide, and planning documents..agents/: tracked agent operating aids; never imported by package runtime code.dist/, coverage, logs, and installed dependencies are generated output and must not be hand-edited or committed.
- Test first. Write one focused failing Vitest test, run it and confirm the expected failure, then write the smallest production code to pass it.
- Strict TypeScript. Do not introduce
any,@ts-ignore, implicitundefinedbehavior, or unchecked external data. Accept runtime input asunknown, then validate it. - Explicit public contracts. Exported APIs need typed options, behavior tests, documentation, and semver-conscious names.
- Safe MCP errors. Validation and handler failures return safe MCP error content; never send application stack traces or secrets to clients.
- Framework neutrality. Core knows only the resolver interface. LangChain interoperability belongs in the
@theorvane/type-mcp/langchainsubpath; LangGraph graphs, model calls, and application lifecycles remain consumer responsibilities. - YAGNI. Do not add OAuth, persistence, legacy SSE, resource templates, application-framework modules, or graph runtimes unless a separately approved scope document changes.
- Small commits. One intent per commit with a conventional message. Do not mix formatting churn or unrelated refactors into feature work.
Every change after the initial repository bootstrap follows this sequence. Never commit directly to protected dev or main.
- Inspect existing open issues and PRs, then create or update one focused GitHub Issue before branching.
- Put the issue number in the branch:
<type>/<issue-number>-<short-description>— for example,feat/12-tool-compilerorchore/1-strict-workspace-baseline. - Branch from the current
origin/devunless a documented stacked PR requires another base. - Implement one coherent issue only. Commit with conventional format:
type(scope): subject. - Push the branch and open a PR against
devwithCloses #<issue-number>in the body. - Run and report fresh verification evidence; obtain specification and code-quality review before merge.
- Squash merge only after CI/review passes, then verify the issue is closed and
devcontains the merged commit. - Promote vetted
devto release-onlymainin a separate reviewed release PR; verifymaincontains the release commit before publication.
- Read the linked GitHub Issue, relevant product/architecture/API docs, and precise task in
docs/planning/. - Create a task brief from
.agents/templates/task-brief.mdif the change touches more than one behavior. - Add one failing test near the behavior under test.
- Run the focused test and record the expected failure in the task brief or commit context.
- Implement the smallest safe change.
- Re-run the focused test, then affected package tests.
- Run
npm run typecheckwhen changing TypeScript public or internal source. - Update README/API/architecture docs for user-visible behavior or decisions.
- Review the exact diff and complete
.agents/checklists/pre-commit.md. - Commit only after the required checks pass; push and open/update the linked PR.
npm ci
npm run lint
npm run typecheck
npm test
npm run build
npm run verify:package
npm run verify:publish
git diff --check
git status --short --branchBefore pushing or claiming completion, all applicable commands above must complete successfully in the current worktree. For a release or external publication, also complete .agents/checklists/release-readiness.md and verify remote main matches local HEAD.
- Product intent:
docs/product/ - Architecture/decision records:
docs/architecture/ - Public API behavior and A/E/X tables:
docs/api/ - Developer integration guides:
docs/guides/ - Approved executable work breakdown:
docs/planning/ - Design history:
docs/superpowers/specs/
Use Korean or English consistently within each document. Code identifiers and command output remain in English. Do not present planned APIs as implemented APIs.
A task is complete only when its specified behavior has a test that was observed failing before implementation, the focused and affected suites pass, strict typecheck/build pass where applicable, docs are current, the pre-commit checklist is satisfied, and the committed diff contains only the intended change.