{"id":28297846,"url":"https://github.com/rekog-labs/mcp-nest","last_synced_at":"2026-02-18T08:01:12.213Z","repository":{"id":274375434,"uuid":"922709376","full_name":"rekog-labs/MCP-Nest","owner":"rekog-labs","description":"A NestJS module to effortlessly create Model Context Protocol (MCP) servers for exposing AI tools, resources, and prompts.","archived":false,"fork":false,"pushed_at":"2026-02-15T15:54:11.000Z","size":1142,"stargazers_count":577,"open_issues_count":18,"forks_count":102,"subscribers_count":7,"default_branch":"main","last_synced_at":"2026-02-15T22:42:25.736Z","etag":null,"topics":["llm","llms","mcp","mcp-nest","model-context-protocol","modelcontextprotocol","nestjs"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rekog-labs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-01-26T22:21:27.000Z","updated_at":"2026-02-15T15:54:15.000Z","dependencies_parsed_at":"2025-03-20T20:08:17.446Z","dependency_job_id":"91d22e87-3702-443c-a57d-99ddbffb04ee","html_url":"https://github.com/rekog-labs/MCP-Nest","commit_stats":null,"previous_names":["rekog-labs/nest-mcp","rekog-labs/mcp-nest"],"tags_count":20,"template":false,"template_full_name":null,"purl":"pkg:github/rekog-labs/MCP-Nest","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rekog-labs%2FMCP-Nest","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rekog-labs%2FMCP-Nest/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rekog-labs%2FMCP-Nest/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rekog-labs%2FMCP-Nest/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rekog-labs","download_url":"https://codeload.github.com/rekog-labs/MCP-Nest/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rekog-labs%2FMCP-Nest/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29573399,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-18T07:57:19.261Z","status":"ssl_error","status_checked_at":"2026-02-18T07:57:18.820Z","response_time":162,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["llm","llms","mcp","mcp-nest","model-context-protocol","modelcontextprotocol","nestjs"],"created_at":"2025-05-23T05:14:30.943Z","updated_at":"2026-02-18T08:01:12.208Z","avatar_url":"https://github.com/rekog-labs.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# NestJS MCP Server Module\n\n\u003cdiv align=\"center\"\u003e\n  \u003cimg src=\"https://raw.githubusercontent.com/rekog-labs/MCP-Nest/main/image.png\" height=\"200\"\u003e\n\n[![CI][ci-image]][ci-url]\n[![Code Coverage][code-coverage-image]][code-coverage-url]\n[![NPM Version][npm-version-image]][npm-url]\n[![NPM Downloads][npm-downloads-image]][npm-url]\n[![NPM License][npm-license-image]][npm-url]\n\n\u003c/div\u003e\n\nA NestJS module to effortlessly expose tools, resources, and prompts for AI, from your NestJS applications using the **Model Context Protocol (MCP)**.\n\nWith `@rekog/mcp-nest` you define tools, resources, and prompts in a way that's familiar in NestJS and leverage the full power of dependency injection to utilize your existing codebase in building complex enterprise ready MCP servers.\n\n## Features\n\n- 🚀 **[Multi-Transport Support](docs/server-examples.md#multiple-transport-types)**: HTTP+SSE, Streamable HTTP, and STDIO\n- 🔧 **[Tools](docs/tools.md)**: Expose NestJS methods as MCP tools with automatic discovery and Zod validation\n  - 🛠️ **[Elicitation](docs/tools.md#interactive-tool-calls)**: Interactive tool calls with user input elicitation\n  - 🌐 **[HTTP Request Access](docs/tools.md#understanding-tool-method-parameters)**: Full access to request context within MCP handlers\n  - 🔐 **[Per-Tool Authorization](docs/per-tool-authorization.md)**: Implement fine-grained authorization for tools\n- 📁 **[Resources](docs/resources.md)**: Serve content and data through MCP resource system\n- 📚 **[Resource Templates](docs/resource-templates.md)**: Dynamic resources with parameterized URIs\n- 💬 **[Prompts](docs/prompts.md)**: Define reusable prompt templates for AI interactions\n- 🔐 **[Guard-based Authentication](docs/server-examples.md#server-with-authentication)**: Guard-based security with OAuth support\n- 🏠 **[Built-in Authorization Server](docs/built-in-authorization-server.md)** — Using the built-in Authorization Server for easy setups. **(Beta)**\n- 🌐 **[External Authorization Server](docs/external-authorization-server/README.md)** — Securing your MCP server with an external authorization server (Keycloak, Auth0, etc).\n- 💉 **[Dependency Injection](docs/dependency-injection.md)**: Leverage NestJS DI system throughout MCP components\n- 🔍 **[Server mutation and instrumentation](docs/server-mutation.md)** — Mutate the underlying mcp server for custom logic or instrumentation purposes.\n\n**Are you interested to build ChatGPT widgets (with the OpenAI SDK) or MCP apps?**\nFind out how to do that with `@rekog/MCP-Nest` in this repository [MCP-Nest-Samples](https://github.com/rinormaloku/MCP-Nest-Samples)\n\n## Installation\n\n```bash\nnpm install @rekog/mcp-nest @modelcontextprotocol/sdk zod@^4\n```\n\n### Optional dependencies\n\nIf you use the built-in authorization server with the TypeORM store, install the following optional peer dependencies:\n\n```bash\nnpm install @nestjs/typeorm typeorm\n```\n\n## Quick Start\n\n```typescript\n// app.module.ts\nimport { Module } from '@nestjs/common';\nimport { McpModule } from '@rekog/mcp-nest';\nimport { GreetingTool } from './greeting.tool';\n\n@Module({\n  imports: [\n    McpModule.forRoot({\n      name: 'my-mcp-server',\n      version: '1.0.0',\n    }),\n  ],\n  providers: [GreetingTool],\n})\nexport class AppModule {}\n```\n\n```typescript\n// greeting.tool.ts\nimport { Injectable } from '@nestjs/common';\nimport { Tool, Context } from '@rekog/mcp-nest';\nimport { z } from 'zod';\n\n@Injectable()\nexport class GreetingTool {\n  @Tool({\n    name: 'greeting-tool',\n    description: 'Returns a greeting with progress updates',\n    parameters: z.object({\n      name: z.string().default('World'),\n    }),\n  })\n  async sayHello({ name }, context: Context) {\n    await context.reportProgress({ progress: 50, total: 100 });\n    return `Hello, ${name}!`;\n  }\n}\n```\n\n## Documentation\n\n- **[Tools Guide](docs/tools.md)** - Define and expose NestJS methods as MCP tools\n- **[Discovery and Registration of Tools](docs/tool-discovery-and-registration.md)** - Automatic discovery and manual registration of tools\n- **[Dynamic Tools Guide](docs/dynamic-tools.md)** - Register tools programmatically at runtime\n- **[Resources Guide](docs/resources.md)** - Serve static and dynamic content\n- **[Resource Templates Guide](docs/resource-templates.md)** - Create parameterized resources\n- **[Prompts Guide](docs/prompts.md)** - Build reusable prompt templates\n- **[Built-in Authorization Server](docs/built-in-authorization-server.md)** - Secure your MCP server with built-in OAuth\n- **[External Authorization Server](docs/external-authorization-server/README.md)** - Securing your MCP server with an external authorization server (Keycloak, Auth0, etc)\n- **[Server examples](docs/server-examples.md)** - MCP servers examples (Streamable HTTP, HTTP, and STDIO) and with Fastify support\n\n## Playground\n\nThe `playground` directory contains working examples for all features.\nRefer to [`playground/README.md`](playground/README.md) for details.\n\n\u003c!-- Badges --\u003e\n[ci-url]: https://github.com/rekog-labs/MCP-Nest/actions/workflows/pipeline.yml\n[ci-image]: https://github.com/rekog-labs/MCP-Nest/actions/workflows/pipeline.yml/badge.svg\n[npm-url]: https://www.npmjs.com/package/@rekog/mcp-nest\n[npm-version-image]: https://img.shields.io/npm/v/@rekog/mcp-nest\n[npm-downloads-image]: https://img.shields.io/npm/d18m/@rekog/mcp-nest\n[npm-license-image]: https://img.shields.io/npm/l/@rekog/mcp-nest\n[code-coverage-url]: https://codecov.io/gh/rekog-labs/mcp-nest\n[code-coverage-image]: https://codecov.io/gh/rekog-labs/mcp-nest/branch/main/graph/badge.svg\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frekog-labs%2Fmcp-nest","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frekog-labs%2Fmcp-nest","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frekog-labs%2Fmcp-nest/lists"}