Skip to content

feat(mcp): unified MCP server registration for tool and resource access (RFC-0058) - #372

Open
Million-mo wants to merge 5 commits into
wolf1069b:mainfrom
Million-mo:feat/mcp-resource-unified-registration
Open

feat(mcp): unified MCP server registration for tool and resource access (RFC-0058)#372
Million-mo wants to merge 5 commits into
wolf1069b:mainfrom
Million-mo:feat/mcp-resource-unified-registration

Conversation

@Million-mo

Copy link
Copy Markdown
Collaborator

Summary

Implements RFC-0058: Unified MCP Server Registration. Top-level MCP servers were previously represented as a child of SkillManagerCap, making their resources invisible to @ mention (/experimental/resource) while their tools flowed through a separate get_capabilities() path — the "dual-object problem".

Now each top-level McpServerCap is registered independently at POOL scope in the ExtensionRegistry and injected directly into agent tool capabilities, unifying tool + resource access behind one object per MCP server.

Changes

Implementation

  • capabilities/mcp_server_cap.py: adds tool_prefix (model-visible namespace from display_name); get_toolset() wraps tools in PrefixedToolset; list_resources() prefers server title over raw name
  • capabilities/skill_manager_cap.py: implements ResourceAccess, delegating to skill-level MCP children
  • delegation/pool.py: registers each top-level McpServerCap independently at POOL scope in _rebuild_skill_capabilities()
  • mcp_server/manager.py: de-duplicates display_name tool prefixes (kbkb_2); adds exclude_global flag to get_capabilities()
  • agents/native_agent/agent.py: get_agentlet() injects top-level McpServerCap directly into tool_capabilities; session/skill configs use get_capabilities(exclude_global=True)
  • routes/agent_routes.py: /experimental/resource lists resources by URI so opencode @ mention surfaces them consistently

Tests (74 passed)

  • New: test_skill_manager_cap_resource_access.py — 9 ResourceAccess delegation cases
  • test_pool_skills.py — top-level McpServerCap POOL registration + tool_prefix de-dup
  • test_mcp_server_cap.py — resource title preference + prefixed toolset
  • test_factory.py — updated scope assertion

Docs & Examples

  • RFC-0058 design doc (decision lineage RFC-0051 → 0052 → 0058, open questions)
  • examples/kb_mcp_server_example.py — demo KB server with dynamic resources/list (background scan of kb_data/, no restart needed)

Test Evidence

74 passed, 2 skipped in 2.79s

Notes

Million-mo and others added 5 commits August 15, 2026 15:00
…ion to SkillManagerCap

McpServerCap gains a model-visible tool namespace (derived from display_name)
so prefixed MCP tool names are predictable. list_resources() now prefers the
server-provided title over the raw name. SkillManagerCap implements
ResourceAccess, delegating to its skill-level MCP children, so top-level
resources are discoverable through the ExtensionRegistry (RFC-0058).

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
…ools directly

AgentPool._rebuild_skill_capabilities() now registers each top-level
McpServerCap independently in the ExtensionRegistry at POOL scope, making
them discoverable via get_resource_access() for @ mention. get_agentlet()
injects these providers directly into tool_capabilities and passes
exclude_global=True to get_capabilities() so session/skill configs are not
double-processed. MCPManager de-duplicates display_name tool prefixes and
supports the exclude_global flag. /experimental/resource lists resources by
URI so opencode @ mention surfaces them consistently (RFC-0058).

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
…eAccess delegation

Adds test_skill_manager_cap_resource_access.py (9 delegation cases for the
new ResourceAccess implementation), McpServerCap resource title preference
and prefixed toolset cases, top-level MCP pool registration + tool_prefix
de-duplication in test_pool_skills.py, and updates the factory scope
assertion to filter ResourceAccess caps correctly (RFC-0058).

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Describes the dual-object problem (tools via get_capabilities, resources via
SkillManagerCap.children) and the decision to register each top-level
McpServerCap independently at POOL scope with direct tool injection.
Documents the RFC-0051 -> RFC-0052 -> RFC-0058 decision lineage and the
open question on top-level vs skill-MCP prefix convention divergence.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
…list

Demo server exposing kb_data/ files as kb:// static resources plus
resource templates. resources/list is re-scanned in the background
(--scan-interval) so files added or removed from kb_data appear in
@ mention without a server restart (RFC-0058).

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
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