Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

README.md

mcp-server-typescript-express

A minimal MCP server, integrated with Keycard identity, authentication and authorization, using @keycardai/mcp, the official MCP v2 SDK (@modelcontextprotocol/server), and Express 5 over the Streamable HTTP transport.

This template is a plain Node project. There is no scaffolding step — copy the directory, install, and run.

Run it

cp -R mcp-server-typescript-express my-mcp-server
cd my-mcp-server
npm install
export KEYCARD_URL=https://your-url.keycard.cloud
npm run build
npm run start

The server listens on http://localhost:8000/mcp and registers itself against keycard at KEYCARD_URL.

Develop

npm run dev

Configure

Env var Default Purpose
KEYCARD_URL (required) URL the server registers against.
KEYCARD_RESOURCE_ID mcp-server-typescript-express Keycard Resource id used by the middleware.
PORT 8000 Local HTTP port.

Keycard provisioning

Before the server can accept requests, the Keycard needs a Resource and a policy that lets your principal call the hello tool. See SPEC.md for the exact resources and policy shape the agent should provision.

Add a tool

Drop a new file in src/tools/ and register it from src/server.ts. Tools added here are automatically gated by your Keycard policy — see the keycard-upsert-policy skill for editing rules.