mcp-task-api
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
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: Swagger MCP Adapter
π οΈ Tech Stack
Framework: NestJS (Node.js)
Language: TypeScript
ORM: Prisma with SQLite
Protocol: @modelcontextprotocol/sdk
Package Manager: PNPM
πΏ 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 .envGenerate 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 generate3. 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
443is recommended to avoid connectivity issues on platforms like ChatGPT.Authentication: Implemented via
X-API-Keyin the header, ensuring only authorized agents can invoke the tools.
π¨βπ» About the Author
David FernandesFull Stack Developer specialized in React, Next.js, and TypeScript.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelogβ¦
This server cannot be deployed
Maintenance
Related MCP Connectors
Nifty's MCP server β exposes tasks, projects, messages, and files as tools for AI agents.
Host any HTTP API as a standard MCP server; auto-distribute to 12+ mainstream agent platforms.
MCP server for your apps' tools and custom tools, plus hosted AI agents and approval-gated workflows
Remote MCP server exposing your Node Command fleet (files, shell, processes, browser) to AI hosts.
Related MCP Servers
- AlicenseBqualityDmaintenanceAn 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.1MIT
- AlicenseAqualityDmaintenanceA TypeScript-based MCP server that integrates with Swagger/OpenAPI specifications to expose API endpoints as tools for Large Language Models (LLMs), enabling natural language interaction with any OpenAPI-compliant API.49MIT
- AlicenseBqualityDmaintenanceExperimental MCP server built with NestJS and LangGraph, enabling tool execution and agent workflows via stdio transport. Supports OpenAI and Ollama models for flexible agent orchestration.4ISC
- AlicenseNot gradedqualityDmaintenanceBuild MCP servers inside NestJS applications using ordinary controllers with decorators for tools, resources, and prompts, supporting authentication and authorization.40 npmMIT