Skip to main content
Glama
asaleh-lab

ts-mcp-agents

by asaleh-lab

ts-mcp-agents

This repo demonstrates how to put a tool on an MCP server and call it from a client. The example we will use is The Landing, a small coworking floor with a handful of bookable rooms. In our case we need the desk note for a room, without baking that lookup into the chat model.

This is the TypeScript MCP SDK copy of the Python FastMCP repo. FastMCP is Python. We hang the same Landing tools on @modelcontextprotocol/sdk.

Setup

npm install
copy .env.example .env

Put your OpenAI API key in .env.

Related MCP server: notes-box

Hang one room lookup on a server

npx tsx src/hello-mcp.ts

Put the notes on the server as a search, a file, and a prompt

npx tsx src/mcp-rag-server.ts

Call the search over STDIO

npx tsx src/stdio-client.ts

Call the search over HTTP

npx tsx src/http-client.ts

Talk to the rooms server and the desk server

npx tsx src/multi-server.ts

Keep the notes inside the client's root, then ask the client to draft a sign

npx tsx src/sampling-roots.ts

Ask before we write a booking

npx tsx src/elicitation.ts

Run the same search on STDIO, then on HTTP

npx tsx src/stdio-client.ts
npx tsx src/http-client.ts

Same tool, same question. Only the pipe changes. You should see Room C, then the Quiet Room note that points at Room C or the Board. The notes themselves should not change.

Related MCP Connectors

Related MCP Servers