Repository navigation
Add Cohesivity MCP bridge; keep top-level oneOf tool parameters - #961
shouryamaanjain wants to merge 1 commit into
Conversation
Cohesivity's provision_resource lists its arguments under a top-level oneOf. The gateway read only top-level properties, so it advertised the tool with no parameters and stripped every argument. Both schema converters now merge the branches.
|
👋 Welcome, @shouryamaanjain, and thanks for opening your first PR on AnythingMCP! A few quick pointers:
Someone from the core team will look at this within ~48h. If you don't hear back, please ping us in Discussions / Q&A. ⭐ While you wait — if you find AnythingMCP useful, a star helps others discover it. |
|
All contributors have signed the CLA ✍️ ✅ |
|
I have read the CLA Document and I hereby sign the CLA |
keysersoft
left a comment
There was a problem hiding this comment.
Thanks, Shouryamaan, and thanks for disclosing your affiliation up front. The oneOf merge is a genuinely useful fix, and the snapshot matches what cohesivity.ai/mcp serves today. Before we can merge, two things on the shared /mcp endpoint (the one most Cloud users connect to), which wasn't covered by your manual test:
inputSchemaOf()inshared-toolset.tsalways setsproperties: {}, sotoolSchemaProperties()sees an (empty)propertiesobject and skips the merge.anythingmcp_run_write_tooltherefore still strips every argument ofcohesivity_provision_resource. Treating an emptypropertiesas absent (or flattening ininputSchemaOf) fixes it; a test throughregisterSharedToolsetwould be great.answerToolsListinmcp-endpoint.controller.tsstill advertises the raw schema with a top-leveloneOf. We'd rather advertise the merged object there too, since some clients reject a top-leveloneOf/anyOfin tool schemas.
Small one: please drop the ?ref= parameter from docsUrl.
We're also still deciding internally how anonymous tenant creation should work from our shared Cloud IP, so the connector may start out as self-hosted only. We'll let you know. Thanks again for the careful write-up!
Summary
Adds a Cohesivity adapter: an AI assistant connected to AnythingMCP can set up a backend for the project it is building (Postgres, hosting, email, storage and more) through Cohesivity's hosted MCP server. The server needs no account or API key, so the connector installs with nothing to fill in.
It is an MCP bridge like Stripe and Linear (#830, #904). Testing it through the gateway turned up a bug that affects any bridged tool of this shape:
provision_resourcelists its arguments under a top-leveloneOf, and both schema converters read only top-levelproperties. The tool was advertised with no parameters and every argument was stripped, so the call failed witharguments.tenant_id is required.This PR also fixes that.Changes
packages/backend/src/adapters/intl/cohesivity.json:connector.type: MCP,authType: NONE, prefixcohesivity_. Six tools in the snapshot;give_feedbackinstalls switched off because its text goes to Cohesivity. The instructions cover the tenant keys passing through tool calls (and so the audit log), the 72-hour ephemeral tenant, and the 10-per-minute-per-IP creation limit a shared gateway runs into.cohesivity.live.spec.ts: static checks, plustools/listand a read-only documentation call behindRUN_COHESIVITY_LIVE=1. It never callscreate_tenant, since every call creates a tenant.mcp-server/tool-schema.util.ts:toolSchemaProperties()merges the branches of a top-leveloneOf/anyOfwhen the schema has nopropertiesof its own. A property is required only when every branch requires it, and value lists (enum/const) are merged.jsonSchemaToZodShapeandMcpServerService.jsonSchemaToZodboth use it. Schemas with top-levelpropertiesare unchanged.tool-schema.util.spec.ts: tests for the merge and for arguments surviving Zod parsing.catalog.tsregenerated, counts bumped to 326 adapters / 18 keyless peradapter-count.mjs --check, logo atlogos/connectors/cohesivity.svg.Type
Testing
From the repository root, Node 22:
In
packages/backend:Manual, self-hosted backend on Postgres 17: imported the adapter with
POST /api/adapters/cohesivity/import(probetools/listok, 6 tools,give_feedbackoff), then connected Claude Code to the server's/mcp/<serverId>with Bash, file writes and web fetch disabled, so only the gateway's tools were available. Asked for a Postgres database: it created a tenant and provisioned Postgres throughcohesivity_provision_resource. Before the converter fix, the same call failed witharguments.tenant_id is required.Not tested: the frontend (store page and logo), the Cloud shared
/mcpinfixedmode, clients other than Claude Code, andprobe-keyless.mjsfrom a datacenter address.Checklist
npm test)Related Issues
Relates to #830 and #904.
Disclosure: I work at Cohesivity, which operates this MCP server.