-
Notifications
You must be signed in to change notification settings - Fork 82
Open
Description
When running the exact example from the README:
import { CodeModeUtcpClient } from '@utcp/code-mode';
const client = await CodeModeUtcpClient.create();
// Connect to GitHub MCP server
await client.registerManual({
name: 'github',
call_template_type: 'mcp',
config: {
mcpServers: {
github: {
command: 'docker',
args: ['run', '-i', '--rm', '-e', 'GITHUB_PERSONAL_ACCESS_TOKEN', 'mcp/github'],
env: { GITHUB_PERSONAL_ACCESS_TOKEN: process.env.GITHUB_TOKEN }
}
}
}
});I get an error:
Zod validation failed for call template 'github' after variable substitution. [
{
code: "custom",
message: "Invalid CallTemplate object",
fatal: true,
path: [],
}
]
1554 | async substituteCallTemplateVariables(callTemplate, namespace) {
1555 | const rawSubstituted = await this.variableSubstitutor.substitute(callTemplate, this.config, namespace);
1556 | const result = CallTemplateSchema.safeParse(rawSubstituted);
1557 | if (!result.success) {
1558 | console.error(`Zod validation failed for call template '${callTemplate.name}' after variable substitution.`, result.error.issues);
1559 | throw new Error(`Invalid call template after variable substitution: ${result.error.message}`);
^
error: Invalid call template after variable substitution: [
{
"code": "custom",
"message": "Invalid CallTemplate object",
"fatal": true,
"path": []
}
]
at substituteCallTemplateVariables (/Users/harris/Documents/slack-buddy/node_modules/@utcp/sdk/dist/index.js:1559:17)
at async registerManual (/Users/harris/Documents/slack-buddy/node_modules/@utcp/sdk/dist/index.js:1381:46)
This is fixed by installing the @utcp/mcp package and modifying the example to be:
// Added import of @utcp/mcp
import "@utcp/mcp";
import { CodeModeUtcpClient } from '@utcp/code-mode';
const client = await CodeModeUtcpClient.create();
// Connect to GitHub MCP server
await client.registerManual({
name: 'github',
call_template_type: 'mcp',
config: {
mcpServers: {
github: {
transport: "stdio", // Transport is required
command: 'docker',
args: ['run', '-i', '--rm', '-e', 'GITHUB_PERSONAL_ACCESS_TOKEN', 'mcp/github'],
env: { GITHUB_PERSONAL_ACCESS_TOKEN: process.env.GITHUB_TOKEN }
}
}
}
});Metadata
Metadata
Assignees
Labels
No labels