Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions docs/mcp_provider_interface.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,25 +95,28 @@ interface MCPContextValue {

### Prefixing Strategy
Tools from each server are prefixed with the user-provided server name to avoid conflicts:
The implementation normalizes the server name and uses `__` as the separator so
prefixed tool names stay within provider tool-name constraints that disallow dots.

```typescript
// Original tool from weather server: "get_weather"
// Prefixed tool: "weather_server.get_weather"
// Prefixed tool: "weather_server__get_weather"

// Original tool from calendar server: "get_events"
// Prefixed tool: "calendar.get_events"
// Prefixed tool: "calendar__get_events"
```

### Tool Discovery and Registration
```typescript
class MCPConnection {
private async discoverTools(): Promise<Tool[]> {
const tools = await this.client.listTools();
const normalizedServerName = normalizeServerName(this.name);
return tools.map(tool => ({
...tool,
function: {
...tool.function,
name: `${this.name}.${tool.function.name}`, // Add prefix
name: `${normalizedServerName}__${tool.function.name}`, // Add prefix
description: `[${this.name}] ${tool.function.description}`, // Add server context
}
}));
Expand Down Expand Up @@ -302,4 +305,4 @@ interface MCPMessage {
3. **Caching**: Tool schema and response caching
4. **Monitoring**: Connection health monitoring and alerts
5. **Batch Operations**: Bulk tool calling and resource access
6. **Custom Transports**: Support for WebSocket and custom transport protocols
6. **Custom Transports**: Support for WebSocket and custom transport protocols