Skip to main content
Glama
tanvir-ux

typescript-mcp-server-demo

by tanvir-ux

typescript-mcp-server-demo

Node.js / TypeScript MCP-style tool server skeleton for startups wiring agent tools. Exposes list_tools + call_tool (JSON-RPC 2.0) over stdio or HTTP JSON. No API keys required — tools are local stubs suitable for demos and integration tests.

Why this shape

Concern

Approach in this repo

Discovery

list_tools / tools/list returns name, description, JSON Schema

Invocation

call_tool / tools/call with name + arguments

Transport

MCP_TRANSPORT=stdio (default) or http

Startup fit

HTTP for Postman / gateways; stdio for local agent hosts

Safety

Fake CRM only; no secrets committed

Protocol-light on purpose: integrate a tool plane without locking to one MCP SDK version. Swap handlers for real CRM / billing / support APIs when you harden.

Related MCP server: wazza-mcp-test-server

Tools

Name

Purpose

echo

Connectivity check — returns message

get_time

Current server time (UTC ISO-8601)

fake_crm_lookup

In-memory customer lookup by customerId or email

Demo CRM ids: cust_1001, cust_1002, cust_1003.

Architecture

Client (agent / IDE)
   |
   |- stdio: one JSON-RPC object per line on stdin -> stdout
   |- HTTP: /health /tools /rpc /tools/call
              |
              v
        handleRequest() -> ToolRegistry -> echo | get_time | fake_crm_lookup

Requirements

  • Node.js 18+

  • package manager compatible with the lockfile-free package.json in this repo

Setup

Install dependencies, optionally copy the env example file, then build TypeScript to dist/. Scripts are defined in package.json: build, start, start:http, start:stdio, dev, dev:http, test.

Run

Set MCP_TRANSPORT to http (port via MCP_PORT, default 3100) or stdio (default).

HTTP routes:

  • GET /health — liveness

  • GET /tools — list_tools shortcut

  • POST /rpc — full JSON-RPC body

  • POST /tools/call — body with name and arguments

Example tools/call body:

{"name":"echo","arguments":{"message":"hello"}}

Example JSON-RPC call_tool:

{"jsonrpc":"2.0","id":1,"method":"call_tool","params":{"name":"fake_crm_lookup","arguments":{"customerId":"cust_1001"}}}

Test

Run the package.json test script. Uses Node built-in test runner (node:test) via tsx.

Config

Variable

Default

Notes

MCP_TRANSPORT

stdio

stdio or http

MCP_HOST

127.0.0.1

HTTP bind host

MCP_PORT

3100

HTTP port

MCP_SERVER_NAME

typescript-mcp-server-demo

Log / health label

See .env.example.

Project layout

src/
  index.ts
  server.ts
  types.ts
  tools/ (echo, get-time, fake-crm-lookup, index)
  transports/ (stdio, http)
tests/
  tools.test.ts
  server.test.ts

Integrating into a startup agent stack

  1. Discover tools at boot (GET /tools or list_tools) and cache schemas for the LLM tool-calling layer.

  2. Call tools from your agent loop with structured arguments; surface content[].text to the model and data to your app layer.

  3. Replace fake_crm_lookup with a real CRM client behind the same RegisteredTool interface — keep names/schemas stable for prompts.

  4. Lock down HTTP with authn/authz and network policy before production; prefer stdio or private mesh for privileged tools.

  5. Graduate to a full MCP SDK transport when you need resources/prompts/sampling; this skeleton stays focused on the tool plane.

License

MIT — see LICENSE.


Author: tanvir-ux

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.

No tool schema history has been recorded yet.

Maintenance

ActivityMaintained
ResponsivenessNo issues

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

  • F
    license
    Not graded
    quality
    C
    maintenance
    A minimal MCP server that exposes tools for addition, echoing text, time lookup, and URL fetching, with support for HTTP and stdio transports.
    -
  • A
    license
    Not graded
    quality
    C
    maintenance
    This server bridges a stdio MCP server to HTTP, allowing MCP clients that communicate over HTTP to use the server's tools. It includes a per-tool allow/deny filter for security.
    MIT

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/tanvir-ux/typescript-mcp-server-demo'

If you have feedback or need assistance with the MCP directory API, please join our Discord server