Skip to main content
Glama

NestJS MCP Tool Demo

A minimal NestJS app that lets Claude use MCP-style tools backed by hardcoded JSON.


Setup

npm install

Create a .env file in the project root:

ANTHROPIC_API_KEY=sk-ant-...your key here...
ANTHROPIC_MODEL=claude-2  # optional override; set this to a model your Anthropic key supports

Start the server:

npx nest start --watch
# or: npm run start:dev

Server runs on http://localhost:3000


Related MCP server: Logseq MCP Server

How to test in Postman

Endpoint

POST http://localhost:3000/ai/ask

Headers

Content-Type: application/json

Body (raw JSON)

{ "message": "What projects are currently active?" }

More example questions to try

{ "message": "Give me full details about the Alpha Launch project" }
{ "message": "Search for documents about authentication" }
{ "message": "Who owns the Gamma API project and what's the deadline?" }
{ "message": "List all projects and then show me the detail of the on-hold one" }

Example Postman response

{
  "answer": "There are two active projects:\n1. **Alpha Launch** (p1) — owned by Alice\n2. **Gamma API** (p3) — owned by Carol",
  "toolCallsUsed": ["get_project_list"],
  "timestamp": "2026-05-18T10:32:00.000Z"
}

The toolCallsUsed field shows exactly which MCP tools Claude chose to call. A log of every tool call is also written to tool-call-log.json in the project root.


Project structure

src/
  ai/
    tools.ts          ← JSON data + tool definitions + executor
    ai.service.ts     ← calls Claude API, runs the tool loop, writes logs
    ai.controller.ts  ← POST /ai/ask endpoint
    ai.module.ts
  app.module.ts
  main.ts

What happens inside (the tool loop)

  1. Postman sends { "message": "..." } to POST /ai/ask

  2. NestJS sends message + tool definitions to Claude API

  3. Claude replies with stop_reason: "tool_use" and picks a tool

  4. NestJS runs the tool against the hardcoded JSON → gets result

  5. NestJS writes the call to tool-call-log.json

  6. NestJS sends the result back to Claude

  7. Claude gives a final text answer (stop_reason: "end_turn")

  8. NestJS returns the answer + list of tools used to Postman

F
license - not found
-
quality - not tested
C
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

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

Related MCP Servers

  • A
    license
    -
    quality
    D
    maintenance
    A NestJS-based server that enables AI agents to interact with Logseq graphs through its HTTP API for managing notes, journals, and blocks. It features specialized tools for project development tracking, including progress logs, technical decisions, and workflow prompts.
    Last updated
    63
    MIT
  • A
    license
    -
    quality
    D
    maintenance
    A local Model Context Protocol (MCP) server that exposes custom tools to Claude Desktop, enabling direct interaction with your local environment. It provides a framework for building and integrating custom TypeScript tools into the Claude interface.
    Last updated
    28
    MIT
  • A
    license
    B
    quality
    D
    maintenance
    An MCP server that exposes structured Functional Requirements Documents (FRDs) to enable AI assistants like GitHub Copilot to automatically generate complete NestJS boilerplate architectures. It orchestrates the multi-phase creation of production-ready APIs including core CRUD, database integration, JWT authentication, and unit testing.
    Last updated
    1
    MIT

View all related MCP servers

Related MCP Connectors

  • MCP server giving Claude AI access to 22+ NYC public-record databases for real estate due diligence

  • MCP server for generating rough-draft project plans from natural-language prompts.

  • Hosted MCP endpoint with realistic fake data for prototyping agents. 12 tools, no setup.

View all MCP Connectors

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/MagarongCandy/MCP_Tools'

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