Summary
Add the ability to expose MCP prompts and resources as callable tools within virtual servers. This would allow clients that only support tool-based interactions to leverage the full MCP specification through a unified tool interface.
Motivation
- Some MCP clients only support tool calls and don't natively handle prompts or resources
- Exposing prompts/resources as tools provides a consistent interaction model
- Enables broader compatibility across different client implementations
- Simplifies integration for clients with limited MCP support
Proposed Behavior
Prompts as Tools
- Each registered prompt becomes a tool with:
- Tool name derived from prompt name (e.g.,
prompt_<name> or configurable prefix)
- Tool arguments matching the prompt's input schema
- Tool response containing the rendered prompt output
Resources as Tools
- Each registered resource becomes a tool with:
- Tool name derived from resource URI or name
- Tool for reading/fetching the resource content
- Optional tools for resource operations (if supported)
Configuration Options
Consider adding virtual server configuration options:
expose_prompts_as_tools: boolean (default: false)
expose_resources_as_tools: boolean (default: false)
tool_name_prefix: customizable prefix for generated tools
resource_tool_operations: list of operations to expose (read, list, etc.)
Implementation Considerations
- Handle naming collisions between native tools and converted prompts/resources
- Preserve metadata and descriptions in tool schemas
- Consider caching strategies for resource-based tools
- Document the mapping conventions for users
Related
- MCP Specification: Prompts, Resources, and Tools
- Virtual server composition logic in
mcpgateway/services/
Summary
Add the ability to expose MCP prompts and resources as callable tools within virtual servers. This would allow clients that only support tool-based interactions to leverage the full MCP specification through a unified tool interface.
Motivation
Proposed Behavior
Prompts as Tools
prompt_<name>or configurable prefix)Resources as Tools
Configuration Options
Consider adding virtual server configuration options:
expose_prompts_as_tools: boolean (default: false)expose_resources_as_tools: boolean (default: false)tool_name_prefix: customizable prefix for generated toolsresource_tool_operations: list of operations to expose (read, list, etc.)Implementation Considerations
Related
mcpgateway/services/