-
-
Notifications
You must be signed in to change notification settings - Fork 0
feat(mcp): support dual-naming and aliasing for Crove Post MCP tools #11
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -53,6 +53,14 @@ export const startMcp = async (app: INestApplication) => { | |||||||||||||||||||||
| 'generateVideoTool', | ||||||||||||||||||||||
| 'generateVideoOptions', | ||||||||||||||||||||||
| 'videoFunctionTool', | ||||||||||||||||||||||
| 'generate_image', | ||||||||||||||||||||||
| 'generate_video', | ||||||||||||||||||||||
| 'generate_video_options', | ||||||||||||||||||||||
| 'video_function', | ||||||||||||||||||||||
| 'crove_post_generate_image', | ||||||||||||||||||||||
| 'crove_post_generate_video', | ||||||||||||||||||||||
| 'crove_post_generate_video_options', | ||||||||||||||||||||||
| 'crove_post_video_function', | ||||||||||||||||||||||
| ]; | ||||||||||||||||||||||
| const claudeTools = Object.fromEntries( | ||||||||||||||||||||||
| Object.entries(tools).filter(([name]) => !claudeHiddenTools.includes(name)) | ||||||||||||||||||||||
|
|
@@ -61,7 +69,11 @@ export const startMcp = async (app: INestApplication) => { | |||||||||||||||||||||
| name: `${brand.name} MCP`, | ||||||||||||||||||||||
| version: '1.0.0', | ||||||||||||||||||||||
| tools, | ||||||||||||||||||||||
| agents: { postiz: agent }, | ||||||||||||||||||||||
| agents: { | ||||||||||||||||||||||
| postiz: agent, | ||||||||||||||||||||||
| crove_post: agent, | ||||||||||||||||||||||
| post: agent, | ||||||||||||||||||||||
| }, | ||||||||||||||||||||||
|
Comment on lines
+72
to
+76
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In We should retrieve the correct agent instance for each key from
Suggested change
|
||||||||||||||||||||||
| }; | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| const server = new MCPServer(serverConfig); | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Assigning the same tool instance reference to multiple alias keys will not work as expected because Mastra registers tools using their internal
nameproperty. Since all aliases share the same reference, they will all have the original name (e.g.,integrationSchedulePostTool), causing them to overwrite each other or fail to register under their alias names.To fix this, we should shallow-clone each tool instance and update its internal
nameproperty to the respective alias.