Install
Install mcpose, its peer dependency, and the optional audit package. Then verify the install with a runnable proxy before wiring up your client.
Prerequisites
- Node.js
20or newer. @modelcontextprotocol/sdk ≥ 1.0as a peer dependency, installed separately below.- TypeScript is optional - mcpose ships ESM with first-class types.
Install
terminal
# core
npm install mcpose
# peer dependency - installed separately
npm install @modelcontextprotocol/sdk@">=1.0.0"
# compliance audit trails (optional)
npm install @mcpose/auditFor the compliance test helpers, install @mcpose/testing as a dev dependency:
terminal
npm install --save-dev @mcpose/testingVerify it works
Save the Quick Start proxy as proxy.ts:
proxy.ts
import { createBackendClient, startProxy } from 'mcpose';
import type { ToolMiddleware } from 'mcpose';
// 1 · Connect to the upstream MCP server (stdio)
const backend = await createBackendClient({
command: 'node',
args: ['/path/to/backend-server.mjs'],
});
// 2 · Define middleware - before and after the upstream call
const logging: ToolMiddleware = async (req, next) => {
console.error(`→ ${req.params.name}`);
const result = await next(req);
console.error(`← ${req.params.name} done`);
return result;
};
// 3 · Start the proxy on stdio
await startProxy(backend, {
toolMiddleware: [logging],
});Run it:
terminal
npx tsx proxy.tsPoint any client at it:
claude_desktop_config.json
{
"mcpServers": {
"governed-search": {
"command": "node",
"args": ["./proxy.ts"]
}
}
}Versions
mcposecore is on 2.x;npm install mcposefetches the current release.@mcpose/audit3.0.0 writes audit format v2, a breaking format change.- Archives written by a 2.x release of
@mcpose/auditverify only against a pinned 2.x:
terminal
npm install @mcpose/audit@2mcpose/testing vs @mcpose/testing
Two similarly named entry points, no relation:
mcpose/testingis a subpath of the core package: in-memory backend and pipeline helpers for proxy tests,createMockBackendClientandrunToolMiddleware. See mcpose/testing.@mcpose/testingis a separate package: keyless compliance assertions for the audit chain,assertAuditChainIntegrity,assertReplayManifestValid,assertPiiRedacted, andassertDelegationHonored. See @mcpose/testing.