Skip to main content
Glama
david-sfernandes

mcp-task-api

NestJS MCP/REST API

A demonstration of integrating enterprise REST APIs with AI Agents using the Model Context Protocol (MCP ).

This project illustrates how to transform a conventional NestJS API into an MCP server, enabling AI agents (such as Claude and ChatGPT) to interact directly with business logic in a secure, standardized way with high code reusability.


💡 Problem & Solution

The Challenge

Integrating AI agents with internal systems usually requires building custom connectors or insecurely exposing API keys within prompts. Furthermore, keeping API documentation (like Swagger) in sync with AI "skills" creates significant maintenance overhead.

The MCP Approach

By leveraging the Model Context Protocol, this API exposes a single standardized endpoint that describes its capabilities to the AI.

  • Security: Maintains authentication via API Key.

  • Engineering: Reuses 100% of existing NestJS Services and Controllers.

  • Scalability: Enables the AI to perform complex operations (CRUD) without requiring specific integration code on the client side.


Related MCP server: FRD Orchestrator

🛠️ Tech Stack


🌿 Branch Structure

To facilitate learning, the repository is organized into:

  • master: Initial REST API boilerplate (starting point for the tutorial).

  • final: Complete implementation with the MCP server configured and integrated.


🚀 Setup & Installation

1. Environment Configuration

cp .env.example .env

Generate a secure key for API_KEY:

node -e "console.log(require('crypto').randomBytes(32).toString('hex'))"

2. Installation & Database

pnpm install
pnpm prisma migrate dev
pnpm prisma generate

3. Execution

# Development mode
pnpm run start:dev

🔌 MCP Interface (Model Context Protocol)

The core advantage of this project is the MCP layer. You can inspect how the AI "sees" your API using the official Inspector:

npx @modelcontextprotocol/inspector --cli http://localhost:3000/mcp --transport http --method tools/list --header "X-API-Key: YOUR_KEY_HERE"

Why is this relevant for Engineering?

Unlike a simple webhook, MCP provides a typed schema of tools. When the AI asks "which tasks are pending?", the MCP server maps this intent directly to TasksService.findAll( ), ensuring that business rules are strictly followed.


🔒 Security & Production

  • SSL/TLS: Essential for production. AI agents require HTTPS for secure communication.

  • Ports: Using the standard port 443 is recommended to avoid connectivity issues on platforms like ChatGPT.

  • Authentication: Implemented via X-API-Key in the header, ensuring only authorized agents can invoke the tools.


👨‍💻 About the Author

David FernandesFull Stack Developer specialized in React, Next.js, and TypeScript.

F
license - not found
Not graded
quality - not tested
B
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

  • F
    license
    Not graded
    quality
    D
    maintenance
    Automatically converts Swagger/OpenAPI specifications into MCP servers, enabling AI agents to interact with any REST API through natural language by exposing endpoints as AI-friendly tools.
    3
  • 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.
    1
    MIT
  • A
    license
    Not graded
    quality
    B
    maintenance
    Converts any OpenAPI specification into an MCP server, allowing AI assistants to interact with REST APIs through natural language.
    9
    1
    MIT

View all related MCP servers

Related MCP Connectors

  • Hosted MCP server to manage a restaurant menu from AI agents - 39 tools over the DuckHub API.

  • MCP server exposing the Backtest360 engine API as tools for AI agents.

  • MCP server for AI agents to plan, verify, and deploy Cloudflare-native apps.

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/david-sfernandes/mcp-task-api'

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