Skip to content

Commit 49f2b4c

Browse files
committed
docs(router): document omit_operation_prefix config for MCP tool names
Add documentation for the new omit_operation_prefix configuration option that allows cleaner MCP tool names without the execute_operation_ prefix. Related: wundergraph/cosmo#2441
1 parent cfef41a commit 49f2b4c

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

docs/router/mcp.mdx

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,7 @@ mcp:
216216
exclude_mutations: true
217217
enable_arbitrary_operations: false
218218
expose_schema: false
219+
omit_operation_prefix: false # When true: GetUser → get_user (no execute_operation_ prefix)
219220

220221
# Configure storage providers
221222
storage_providers:
@@ -237,6 +238,7 @@ storage_providers:
237238
| `exclude_mutations` | Whether to exclude mutation operations from being exposed | `false` |
238239
| `enable_arbitrary_operations` | Whether to allow arbitrary GraphQL operations to be executed. <Warning>Security risk: Should only be enabled in secure, internal environments.</Warning> | `false` |
239240
| `expose_schema` | Whether to expose the full GraphQL schema. <Warning>Security risk: Should only be enabled in secure, internal environments.</Warning> | `false` |
241+
| `omit_operation_prefix` | When true, MCP tool names are generated without the `execute_operation_` prefix (e.g., `GetUser` → `get_user` instead of `execute_operation_get_user`). Can also be set via `MCP_OMIT_OPERATION_PREFIX` environment variable. | `false` |
240242

241243
## Session Handling
242244

@@ -375,6 +377,25 @@ The MCP server converts each operation into a corresponding tool:
375377

376378
Operations are converted to snake_case for tool naming consistency.
377379

380+
#### Omitting the Operation Prefix
381+
382+
By default, all operation tools include the `execute_operation_` prefix. If you prefer shorter, cleaner tool names, enable the `omit_operation_prefix` configuration option:
383+
384+
```yaml
385+
mcp:
386+
enabled: true
387+
omit_operation_prefix: true
388+
```
389+
390+
With this option enabled:
391+
392+
- Operation name: `GetUsers` → Tool name: `get_users`
393+
- Operation name: `CreateUser` → Tool name: `create_user`
394+
395+
<Warning>
396+
Enabling this option changes all tool names and may break existing integrations that rely on the `execute_operation_` prefix. Only enable this for new deployments or when you can update all dependent systems.
397+
</Warning>
398+
378399
### Best Practices
379400

380401
1. **Meaningful names**: Give operations clear, action-oriented names that describe what they do.

0 commit comments

Comments
 (0)