feat(mcp): add MCP extension for exposing APIs as MCP tools#11564
Draft
akshatdubeysf wants to merge 1 commit intoloopbackio:masterfrom
Draft
feat(mcp): add MCP extension for exposing APIs as MCP tools#11564akshatdubeysf wants to merge 1 commit intoloopbackio:masterfrom
akshatdubeysf wants to merge 1 commit intoloopbackio:masterfrom
Conversation
facb438 to
76fb57a
Compare
Add @loopback/mcp extension that enables LoopBack applications to expose their API endpoints as Model Context Protocol (MCP) tools. Includes decorator-based tool registration, schema generation, and server factory. Signed-off-by: Akshat Dubey <akshat.dubey@sourcefuse.com>
76fb57a to
cdd0857
Compare
samarpanB
requested changes
Apr 13, 2026
| as shown below. | ||
|
|
||
| ```ts | ||
| import {McpComponent} from 'loopback4-mcp'; |
| @@ -0,0 +1,5 @@ | |||
| # Repositories | |||
Contributor
There was a problem hiding this comment.
can we remove these empty folders ?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
specification
callable by MCP clients (LLMs, agents, etc.)
support via the provider pattern
McpComponent— drop-in component that registers all services, controllers, and lifecycle observers@mcpTool()decorator — marks controller methods as MCP tools with name, description, optional Zod schema, andhook bindings
McpToolRegistry— service that discovers and stores all decorated tool metadata at bootMcpServerFactory— creates MCP server instances with registered toolsMcpSchemaGeneratorService— generates MCP-compatible schemas from LoopBack parameter metadataMcpController— exposes aPOST /mcpendpoint using StreamableHTTP transportMcpToolRegistryBootObserver— lifecycle observer that triggers tool registration after app bootChecklist
npm testpasses on your machinepackages/cliwere updatedexamples/*were updated👉 Check out how to submit a PR 👈