Skip to content

feat(mcp): support dual-naming and aliasing for Crove Post MCP tools - #11

Merged
JOY (JOY) merged 1 commit into
mainfrom
dev
Aug 26, 2026
Merged

feat(mcp): support dual-naming and aliasing for Crove Post MCP tools#11
JOY (JOY) merged 1 commit into
mainfrom
dev

Conversation

@JOY

@JOY JOY (JOY) commented Aug 26, 2026

Copy link
Copy Markdown

What kind of change does this PR introduce?

Feature & MCP Ecosystem Standard

Why was this change needed?

Implements dual-registration and aliasing for Crove Post MCP tools:

  1. MCP Tool Aliasing: Supports both canonical snake_case (schedule_post, list_channels, list_posts, list_groups, update_post_settings, trigger_integration, validate_integration, upload_from_url) and namespaced aliases (crove_post_*, post_*, postiz_*) alongside original upstream tool names (integrationSchedulePostTool, integrationList, postsListTool).
  2. Multi-Agent Registration: Registers postiz, crove_post, and post agent IDs on Mastra MCP server.
  3. Documentation: Documents the MCP Tool Names Catalog in docs/architecture.md (Section 8.2).

Checklist:


Note

Medium Risk
Changes expand the external MCP tool and agent contract; risk is mostly compatibility and client confusion, not new business logic, since aliases reuse existing tool handlers.

Overview
MCP clients can call the same Crove Post capabilities under multiple tool names without breaking upstream Postiz names (integrationSchedulePostTool, postsListTool, etc.). loadTools() now registers snake_case and prefixed aliases (schedule_post, crove_post_*, post_*, postiz_*) that point to the same tool implementations.

Mastra and the MCP server expose three agent IDs (postiz, crove_post, post) built from the same agent factory with a configurable agentId and brand-aware prompts (generic “application” wording instead of hardcoded Postiz).

Claude directory-facing MCP continues to hide media-generation tools; the hide list now includes the new alias names so those tools stay off that endpoint.

docs/architecture.md adds Section 8.2 with the tool name / aliasing catalog for Tier 2 MCP.

Reviewed by Cursor Bugbot for commit df1e1cb. Bugbot is set up for automated code reviews on this repo. Configure here.

Register friendly snake_case and crove_post/post aliases for MCP tools (schedule_post, list_channels, list_posts) alongside upstream Postiz tool names, ensuring full ecosystem compatibility for DOSClaw and AI agents.

Co-authored-by: Cursor <cursoragent@cursor.com>
@cursor

cursor Bot commented Aug 26, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_5e37a1e4-308e-492f-8099-c3d02425d33f)

@JOY
JOY (JOY) merged commit 702954b into main Aug 26, 2026
5 checks passed

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces MCP tool aliasing and multi-agent support to accommodate Crove OS ecosystem conventions alongside upstream Postiz conventions. It updates the architecture documentation, maps friendly snake_case and prefixed aliases to existing tools, and dynamically configures multiple agents (postiz, crove_post, and post) using brand configurations. The review feedback highlights two critical issues: first, assigning the same tool instance to multiple alias keys will fail because Mastra relies on the tool's internal name property, requiring the tools to be cloned and renamed; second, the MCP server registration incorrectly reuses the same postiz agent instance for all keys instead of retrieving the distinct agent instances from Mastra.

Comment on lines +106 to +113
const expandedTools = { ...directTools };
for (const [originalName, aliasList] of Object.entries(aliases)) {
if (directTools[originalName]) {
for (const alias of aliasList) {
expandedTools[alias] = directTools[originalName];
}
}
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

Assigning the same tool instance reference to multiple alias keys will not work as expected because Mastra registers tools using their internal name property. 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 name property to the respective alias.

Suggested change
const expandedTools = { ...directTools };
for (const [originalName, aliasList] of Object.entries(aliases)) {
if (directTools[originalName]) {
for (const alias of aliasList) {
expandedTools[alias] = directTools[originalName];
}
}
}
const expandedTools = { ...directTools };
for (const [originalName, aliasList] of Object.entries(aliases)) {
const originalTool = directTools[originalName];
if (originalTool) {
for (const alias of aliasList) {
const clonedTool = Object.create(
Object.getPrototypeOf(originalTool),
Object.getOwnPropertyDescriptors(originalTool)
);
clonedTool.name = alias;
expandedTools[alias] = clonedTool;
}
}
}

Comment on lines +72 to +76
agents: {
postiz: agent,
crove_post: agent,
post: agent,
},

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

In mastra.service.ts, three distinct agent instances (postiz, crove_post, and post) are created with their respective IDs and names. However, here you are registering the same postiz agent instance (agent) under all three keys. This causes the other agents to report their ID and name as postiz instead of their respective values.

We should retrieve the correct agent instance for each key from mastra.

Suggested change
agents: {
postiz: agent,
crove_post: agent,
post: agent,
},
agents: {
postiz: mastra.getAgent('postiz'),
crove_post: mastra.getAgent('crove_post'),
post: mastra.getAgent('post'),
},

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant