Skip to content

Add Cohesivity MCP bridge; keep top-level oneOf tool parameters - #961

Open
shouryamaanjain wants to merge 1 commit into
HelpCode-ai:mainfrom
shouryamaanjain:feat/cohesivity-adapter
Open

shouryamaanjain wants to merge 1 commit into
HelpCode-ai:mainfrom
shouryamaanjain:feat/cohesivity-adapter

Conversation

@shouryamaanjain

Copy link
Copy Markdown

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_resource lists its arguments under a top-level oneOf, and both schema converters read only top-level properties. The tool was advertised with no parameters and every argument was stripped, so the call failed with arguments.tenant_id is required. This PR also fixes that.

Changes

  • packages/backend/src/adapters/intl/cohesivity.json: connector.type: MCP, authType: NONE, prefix cohesivity_. Six tools in the snapshot; give_feedback installs 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, plus tools/list and a read-only documentation call behind RUN_COHESIVITY_LIVE=1. It never calls create_tenant, since every call creates a tenant.
  • mcp-server/tool-schema.util.ts: toolSchemaProperties() merges the branches of a top-level oneOf/anyOf when the schema has no properties of its own. A property is required only when every branch requires it, and value lists (enum/const) are merged. jsonSchemaToZodShape and McpServerService.jsonSchemaToZod both use it. Schemas with top-level properties are unchanged.
  • tool-schema.util.spec.ts: tests for the merge and for arguments surviving Zod parsing.
  • catalog.ts regenerated, counts bumped to 326 adapters / 18 keyless per adapter-count.mjs --check, logo at logos/connectors/cohesivity.svg.

Type

  • Bug fix
  • New feature
  • Documentation
  • Refactoring
  • Performance improvement
  • Other (describe below)

Testing

  • Added/updated unit tests
  • Tested manually (describe steps below)
  • No tests needed (explain why)

From the repository root, Node 22:

$ node scripts/validate-adapters.mjs --warn
Validated 342 adapters: 342 passed, 0 failed   (no warnings for cohesivity.json)
$ node scripts/adapter-count.mjs --check
OK: every quoted count equals 326 adapters (18 keyless, 4009 tools).

In packages/backend:

$ npm test
Test Suites: 4 skipped, 483 passed, 483 of 487 total
$ RUN_COHESIVITY_LIVE=1 npx jest src/adapters/intl/cohesivity
all passed
$ npx tsc --noEmit -p tsconfig.json && npm run lint
no errors

Manual, self-hosted backend on Postgres 17: imported the adapter with POST /api/adapters/cohesivity/import (probe tools/list ok, 6 tools, give_feedback off), 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 through cohesivity_provision_resource. Before the converter fix, the same call failed with arguments.tenant_id is required.

Not tested: the frontend (store page and logo), the Cloud shared /mcp in fixed mode, clients other than Claude Code, and probe-keyless.mjs from a datacenter address.

Checklist

  • My code follows the existing code style
  • I have tested my changes locally
  • I have updated documentation (if applicable)
  • All existing tests pass (npm test)
  • This PR has a descriptive title

Related Issues

Relates to #830 and #904.


Disclosure: I work at Cohesivity, which operates this MCP server.

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.
@github-actions

github-actions Bot commented Oct 8, 2026

Copy link
Copy Markdown

👋 Welcome, @shouryamaanjain, and thanks for opening your first PR on AnythingMCP!

A few quick pointers:

  • Make sure CI is green before requesting review (Backend, Frontend, Playwright, CodeQL, Trivy).
  • If this is a new adapter, the parametrised catalog.spec.ts test will validate it automatically.
  • Sign off your commits if you can — it's not blocking, just nice to have.

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.

@github-actions

github-actions Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@shouryamaanjain

Copy link
Copy Markdown
Author

I have read the CLA Document and I hereby sign the CLA

github-actions Bot added a commit that referenced this pull request Oct 8, 2026

@keysersoft keysersoft left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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:

  1. inputSchemaOf() in shared-toolset.ts always sets properties: {}, so toolSchemaProperties() sees an (empty) properties object and skips the merge. anythingmcp_run_write_tool therefore still strips every argument of cohesivity_provision_resource. Treating an empty properties as absent (or flattening in inputSchemaOf) fixes it; a test through registerSharedToolset would be great.
  2. answerToolsList in mcp-endpoint.controller.ts still advertises the raw schema with a top-level oneOf. We'd rather advertise the merged object there too, since some clients reject a top-level oneOf/anyOf in 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!

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.

2 participants