Skip to content

Support MCP tooling hints#938

Merged
jviotti merged 1 commit into
mainfrom
mcp-refactor-2
May 23, 2026
Merged

Support MCP tooling hints#938
jviotti merged 1 commit into
mainfrom
mcp-refactor-2

Conversation

@jviotti
Copy link
Copy Markdown
Member

@jviotti jviotti commented May 23, 2026

Signed-off-by: Juan Cruz Viotti jv@jviotti.com

Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

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

1 issue found across 6 files

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread src/actions/action_mcp_v1.h
@augmentcode
Copy link
Copy Markdown

augmentcode Bot commented May 23, 2026

🤖 Augment PR Summary

Summary: Refactors the MCP implementation to use more explicit data structures and leaner JSON construction.

Changes:

  • Simplified tool descriptors to carry a title string instead of a free-form annotations object.
  • Reworked MCP initialize handling: precomputed metadata is now stored as a compact array and mapped into MCPServerCapabilities / MCPImplementation.
  • Moved/duplicated cursor parsing for resources/list into the enterprise MCP action using std::from_chars.
  • Optimized MCP JSON builders by using precomputed property hashes with assign_assume_new.
  • Added protocol gating helpers for serverInfo fields (title/description/websiteUrl) around MCP protocol version support.

Notes: Both enterprise and OSS MCP actions were updated to match the new initialize metadata layout and descriptor API.

🤖 Was this summary useful? React with 👍 or 👎

Copy link
Copy Markdown

@augmentcode augmentcode Bot left a comment

Choose a reason for hiding this comment

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

Review completed. 3 suggestions posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

Comment thread enterprise/server/action_mcp_v1.cc
Comment thread src/mcp/mcp.cc
sourcemeta::core::JSON{server.title},
MCP_HASH_TITLE);
}
if (!server.description.empty() &&
Copy link
Copy Markdown

@augmentcode augmentcode Bot May 23, 2026

Choose a reason for hiding this comment

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

src/mcp/mcp.cc:333 Emitting serverInfo.description/serverInfo.websiteUrl can conflict with the current initialize response schema (src/self/v1/schemas/mcp/initialize/response.json), where serverInfo.additionalProperties is false and these fields aren’t listed. If these ever become non-empty in metadata, schema validation/e2e checks may start failing.

Severity: low

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

Comment thread src/mcp/mcp.cc
MCP_HASH_CAPABILITIES);
result.assign_assume_new(std::string{"serverInfo"}, std::move(server_info),
MCP_HASH_SERVER_INFO);
if (!instructions.empty()) {
Copy link
Copy Markdown

@augmentcode augmentcode Bot May 23, 2026

Choose a reason for hiding this comment

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

src/mcp/mcp.cc:356 instructions is only emitted when non-empty, but the published initialize response schema currently requires an instructions property with minLength: 1. If any caller passes an empty string (or relies on the default argument), responses will stop conforming to that schema.

Severity: medium

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

@jviotti jviotti changed the title Do another refactoring pass on src/mcp Support MCP tooling hints May 23, 2026
Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

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

Benchmark Index (community)

Details
Benchmark suite Current: e1f7c47 Previous: 15b88fe Ratio
Add one schema (0 existing) 278 ms 284 ms 0.98
Add one schema (100 existing) 25 ms 27 ms 0.93
Add one schema (1000 existing) 83 ms 88 ms 0.94
Add one schema (10000 existing) 686 ms 846 ms 0.81
Update one schema (1 existing) 19 ms 20 ms 0.95
Update one schema (101 existing) 26 ms 28 ms 0.93
Update one schema (1001 existing) 83 ms 87 ms 0.95
Update one schema (10001 existing) 689 ms 723 ms 0.95
Cached rebuild (1 existing) 6 ms 6 ms 1
Cached rebuild (101 existing) 8 ms 8 ms 1
Cached rebuild (1001 existing) 30 ms 31 ms 0.97
Cached rebuild (10001 existing) 269 ms 281 ms 0.96
Index 100 schemas 112 ms 119 ms 0.94
Index 1000 schemas 870 ms 1133 ms 0.77
Index 10000 schemas 12922 ms 14216 ms 0.91

This comment was automatically generated by workflow using github-action-benchmark.

Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

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

Benchmark Index (enterprise)

Details
Benchmark suite Current: e1f7c47 Previous: 15b88fe Ratio
Add one schema (0 existing) 289 ms 277 ms 1.04
Add one schema (100 existing) 29 ms 27 ms 1.07
Add one schema (1000 existing) 86 ms 79 ms 1.09
Add one schema (10000 existing) 703 ms 852 ms 0.83
Update one schema (1 existing) 22 ms 20 ms 1.10
Update one schema (101 existing) 28 ms 26 ms 1.08
Update one schema (1001 existing) 86 ms 78 ms 1.10
Update one schema (10001 existing) 707 ms 640 ms 1.10
Cached rebuild (1 existing) 7 ms 6 ms 1.17
Cached rebuild (101 existing) 9 ms 8 ms 1.13
Cached rebuild (1001 existing) 32 ms 27 ms 1.19
Cached rebuild (10001 existing) 275 ms 239 ms 1.15
Index 100 schemas 132 ms 116 ms 1.14
Index 1000 schemas 1047 ms 1182 ms 0.89
Index 10000 schemas 13560 ms 13674 ms 0.99

This comment was automatically generated by workflow using github-action-benchmark.

Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
@jviotti jviotti merged commit c62ef5e into main May 23, 2026
4 checks passed
@jviotti jviotti deleted the mcp-refactor-2 branch May 23, 2026 23:00
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