-
Notifications
You must be signed in to change notification settings - Fork 0
Feat: Added Mcp Integration #18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
alakkaya
wants to merge
12
commits into
main
Choose a base branch
from
feat/mcp-integration
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 3 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
e629e74
feat(mcp): add mcp-server service to docker-compose and update dependβ¦
alakkaya ee57dff
feat(mcp): add MCP tool not found and category not supported exceptioβ¦
alakkaya 6f0c394
feat(mcp): implement MCP server and authentication tools with requestβ¦
alakkaya 4d06d24
docs: update README to enhance project description and detail MCP intβ¦
alakkaya 8a47c93
feat(mcp): update todo deletion descriptions and add cancellation funβ¦
alakkaya 8739506
feat: add class-validator-jsonschema dependency to enhance validationβ¦
alakkaya 0ffb624
feat(mcp): add MCP tool response formatting and update authenticationβ¦
alakkaya ec2b0bd
feat(mcp): enhance MCP tool with todo functionalities and update descβ¦
alakkaya 31106ce
feat(todo): refactor todo service and DTOs to include userId in creatβ¦
alakkaya c56ea51
revert(todo): dto changes for mcp are reverted
alakkaya 6dd660f
feat(mcp): -NOT WORKED- add DTOs for todo operations including userIdβ¦
alakkaya 10137a0
feat(mcp): refactor MCP tool to use new schemas for authentication anβ¦
alakkaya File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
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
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
12 changes: 12 additions & 0 deletions
12
src/core/error/exception/mcp-category-not-supported.exception.ts
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| import { ErrorCode } from '../error-code'; | ||
| import { BadInputException } from './bad-input.exception'; | ||
|
|
||
| export class McpCategoryNotSupportedException extends BadInputException { | ||
| constructor(category: string) { | ||
| super( | ||
| `MCP tool category '${category}' is not supported`, | ||
| ErrorCode.MCP_CATEGORY_NOT_SUPPORTED, | ||
| `Category '${category}' is not available`, | ||
| ); | ||
| } | ||
| } |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| import { ErrorCode } from '../error-code'; | ||
| import { NotFoundException } from './not-found.exception'; | ||
|
|
||
| export class McpToolNotFoundException extends NotFoundException { | ||
| constructor(toolName: string) { | ||
| super( | ||
| `MCP tool '${toolName}' not found`, | ||
| ErrorCode.MCP_TOOL_NOT_FOUND, | ||
| `Tool '${toolName}' is not available`, | ||
| ); | ||
| } | ||
| } |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,4 @@ | ||
| export * from './environment.interface'; | ||
| export * from './mongo-model'; | ||
| export * from './bullmq'; | ||
| export * from './mcp'; |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| export * from './mcp-tool.const'; |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| export const McpTool = { | ||
| AUTH_REGISTER: { | ||
| name: 'auth_register', | ||
| description: 'Register a new user', | ||
| category: 'auth' as const, | ||
| }, | ||
| AUTH_LOGIN: { | ||
| name: 'auth_login', | ||
| description: 'Login user and get access token', | ||
| category: 'auth' as const, | ||
| }, | ||
| TODO_CREATE: { | ||
| name: 'todo_create', | ||
| description: 'Create a new todo item', | ||
| category: 'todo' as const, | ||
| }, | ||
| TODO_LIST: { | ||
| name: 'todo_list', | ||
| description: 'List user todos with pagination', | ||
| category: 'todo' as const, | ||
| }, | ||
| TODO_UPDATE: { | ||
| name: 'todo_update', | ||
| description: 'Update an existing todo', | ||
| category: 'todo' as const, | ||
| }, | ||
| TODO_DELETE: { | ||
| name: 'todo_delete', | ||
| description: 'Delete a todo item', | ||
alakkaya marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| category: 'todo' as const, | ||
| }, | ||
| } as const; | ||
alakkaya marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| // Type utilities | ||
| export type McpToolKey = keyof typeof McpTool; | ||
| export type McpToolValue = (typeof McpTool)[McpToolKey]; | ||
| export type McpToolName = McpToolValue['name']; | ||
| export type McpToolCategory = McpToolValue['category']; | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| import { NestFactory } from '@nestjs/core'; | ||
| import { AppModule } from './app.module'; | ||
| import { McpServer } from './modules/mcp/server/mcp.server'; | ||
|
|
||
| async function bootstrap() { | ||
| const app = await NestFactory.create(AppModule); | ||
|
|
||
| const mcpServer = app.get(McpServer); | ||
|
|
||
| await mcpServer.start(); | ||
| } | ||
|
|
||
| bootstrap(); |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| import { Module } from '@nestjs/common'; | ||
| import { McpServer } from './server/mcp.server'; | ||
| import { AuthModule } from '../auth/auth.module'; | ||
| import { UserModule } from '../user/user.module'; | ||
|
|
||
| @Module({ | ||
| imports: [AuthModule, UserModule], | ||
| providers: [McpServer], | ||
| exports: [McpServer], | ||
| }) | ||
| export class McpModule {} |
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.