Skip to content

per-server annotation overrides for misbehaving upstreams - #1323

Open
DScoNOIZ wants to merge 12 commits into
smart-mcp-proxy:mainfrom
DScoNOIZ:🚀-FEAT-ANNOTATION-OVERRIDES-🛡️-PER-SERVER-TOOL-EXCEPTIONS-✨

Hidden character warning

The head ref may contain hidden characters: "\ud83d\ude80-FEAT-ANNOTATION-OVERRIDES-\ud83d\udee1\ufe0f-PER-SERVER-TOOL-EXCEPTIONS-\u2728"
Open

DScoNOIZ wants to merge 12 commits into
smart-mcp-proxy:mainfrom
DScoNOIZ:🚀-FEAT-ANNOTATION-OVERRIDES-🛡️-PER-SERVER-TOOL-EXCEPTIONS-✨

Conversation

@DScoNOIZ

Copy link
Copy Markdown

Hi, ran into this with a couple of old mcp servers, browseros in my case. They dont send any annotations at all, so all their tools fall into destructive tier by default. Readonly agents cant even see plain readers like navigate or snapshot, even though theres nothing dangerous in them. Patching every upstream by hand is obviously not an option, so I made operator side overrides.

How it works, theres a new optional map annotation_overrides in the server config. Key is the tool name or a star for all of them at once, value is annotations. Merges per hint on top of what the server sent, priority is straightforward, exact then wildcard then upstream. Whatever is not set is inherited. You can delete with null by key, same as everywhere else in the config. Only admin can change it, both rest and mcp. No restart needed, applies right away on the next get. Written to audit as config_change. Left the tool approval hash alone, its got no business there.

On the ui side I put a card into the server configuration right after trust mode. Theres a compact table plus a mark safe button per tool, it just presets readonly true destructive false and thats it. It never touches openWorldHint by itself, thats manual only if youre really sure. Left the selects three state inherit true false, cause a toggle just cant express inherit.

Compat wise all quiet. Field is omitempty everywhere, old configs load like they used to, without overrides behavior is exactly like before. Covered merge priority validation and admin only with tests. Docs added in config-file and upstream-servers, swagger regenerated.

Tested live on browseros, 24 tools there and 5 with no annotations at all. Readonly token used to see zero browseros tools, after the override navigate is found and called through the read door. Deleted the override and everything flipped right back. If something doesnt fit or needs splitting up, let me know, will rework.

This branch has not been deployed

No deployments
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