@sriramrajendiran/code-mode-mcp 1.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md ADDED
@@ -0,0 +1,181 @@
1
+ # UTCP Code Mode MCP Bridge
2
+
3
+ **Execute TypeScript code with direct tool access through MCP.**
4
+
5
+ An advanced MCP server that brings UTCP Code Mode to the MCP ecosystem, allowing you to execute TypeScript code with all registered tools available as native TypeScript functions.
6
+
7
+ ## 🚀 Quick Start
8
+
9
+ Add this configuration to your MCP client (Claude Desktop, etc.):
10
+
11
+ ```json
12
+ {
13
+ "mcpServers": {
14
+ "utcp-codemode": {
15
+ "command": "npx",
16
+ "args": ["@utcp/code-mode-mcp"],
17
+ "env": {
18
+ "UTCP_CONFIG_FILE": "/path/to/your/.utcp_config.json"
19
+ }
20
+ }
21
+ }
22
+ }
23
+ ```
24
+
25
+ **That's it!** No installation required. The bridge will automatically:
26
+ - Download and run the latest version via npx
27
+ - Load your UTCP configuration from the specified path
28
+ - Register all your UTCP manuals as tools available in TypeScript code
29
+ - Enable TypeScript code execution with hierarchical tool access (e.g., `manual.tool()`)
30
+
31
+ ## 🔧 Configuration
32
+
33
+ Create a `.utcp_config.json` file to configure your tools and services.
34
+
35
+ ### Local Configuration File
36
+
37
+ Create a `.utcp_config.json` file locally:
38
+
39
+ ```json
40
+ {
41
+ "load_variables_from": [
42
+ {
43
+ "variable_loader_type": "dotenv",
44
+ "env_file_path": ".env"
45
+ }
46
+ ],
47
+ "manual_call_templates": [
48
+ {
49
+ "name": "openlibrary",
50
+ "call_template_type": "http",
51
+ "http_method": "GET",
52
+ "url": "https://openlibrary.org/static/openapi.json",
53
+ "content_type": "application/json"
54
+ }
55
+ ],
56
+ "post_processing": [
57
+ {
58
+ "tool_post_processor_type": "filter_dict",
59
+ "only_include_keys": ["name", "description"],
60
+ "only_include_tools": ["openlibrary.*"]
61
+ }
62
+ ],
63
+ "tool_repository": {
64
+ "tool_repository_type": "in_memory"
65
+ },
66
+ "tool_search_strategy": {
67
+ "tool_search_strategy_type": "tag_and_description_word_match"
68
+ }
69
+ }
70
+ ```
71
+
72
+ ### Remote Configuration File
73
+
74
+ You can also use a remote JSON file hosted on any HTTP/HTTPS URL:
75
+
76
+ ```json
77
+ {
78
+ "mcpServers": {
79
+ "utcp-codemode": {
80
+ "command": "npx",
81
+ "args": ["@utcp/code-mode-mcp"],
82
+ "env": {
83
+ "UTCP_CONFIG_FILE": "https://example.com/my-utcp-config.json"
84
+ }
85
+ }
86
+ }
87
+ }
88
+ ```
89
+
90
+ The MCP bridge will automatically detect if `UTCP_CONFIG_FILE` is a URL (starts with `http://` or `https://`) and fetch the configuration remotely. This is useful for:
91
+ - **Shared team configurations** - Host a single config that multiple team members can use
92
+ - **Dynamic configurations** - Update tools without distributing new config files
93
+ - **Centralized management** - Manage multiple MCP instances from a central location
94
+
95
+ **Security Note:** Only use remote URLs from trusted sources, as the configuration can execute code and access your environment variables.
96
+
97
+ ### Enabling CLI Support
98
+
99
+ **Important:** CLI protocol support is **disabled by default** for security reasons. To enable CLI tool execution, you need to explicitly register the CLI plugin in 'index.ts'.
100
+
101
+ ```typescript
102
+ import { register as registerCli } from "@utcp/cli";
103
+
104
+ // Enable CLI support
105
+ registerCli();
106
+ ```
107
+
108
+ **Security Note:** Only enable CLI if you trust the code that will be executed, as CLI tools can execute arbitrary commands on your system.
109
+
110
+ ## 🛠️ Available MCP Tools
111
+
112
+ The bridge exposes these MCP tools for managing your UTCP Code Mode ecosystem:
113
+
114
+ - **`register_manual`** - Register new UTCP manuals/APIs
115
+ - **`deregister_manual`** - Remove registered manuals
116
+ - **`search_tools`** - Find tools by description with TypeScript interfaces
117
+ - **`list_tools`** - List all registered tool names
118
+ - **`get_required_keys_for_tool`** - Get required environment variables
119
+ - **`tool_info`** - Get complete tool information with TypeScript interface
120
+ - **`call_tool_chain`** - Execute TypeScript code with direct tool access
121
+
122
+ ## 📁 What is UTCP?
123
+
124
+ The Universal Tool Calling Protocol (UTCP) allows you to:
125
+ - **Connect to any API** via HTTP, OpenAPI specs, or custom formats
126
+ - **Use command-line tools** with automatic argument parsing (requires explicit CLI plugin registration)
127
+ - **Process text and files** with built-in utilities
128
+ - **Chain and combine** multiple tools seamlessly
129
+
130
+ With this MCP bridge, all your UTCP tools become available in Claude Desktop and other MCP clients.
131
+
132
+ **Optional Protocols:** CLI requires explicit registration for security (see "Enabling CLI Support" above).
133
+
134
+ ## 💻 Code Mode Example
135
+
136
+ The main feature of this bridge is the ability to execute TypeScript code with direct access to all registered tools:
137
+
138
+ ```typescript
139
+ // Example using call_tool_chain
140
+ const result = await call_tool_chain(`
141
+ // Get user data from an API
142
+ const user = await user_service.getUserProfile({ userId: "123" });
143
+ console.log('User data:', user);
144
+
145
+ // Process the data with another tool
146
+ const processed = await data_processor.analyzeUserBehavior({
147
+ userData: user,
148
+ timeframe: "30days"
149
+ });
150
+
151
+ // Generate a report
152
+ const report = await reporting.generateInsights({
153
+ analysis: processed,
154
+ format: "summary"
155
+ });
156
+
157
+ return {
158
+ userId: user.id,
159
+ totalActions: processed.actionCount,
160
+ topInsight: report.insights[0]
161
+ };
162
+ `);
163
+ ```
164
+
165
+ **Key Benefits:**
166
+ - **Hierarchical Access**: Use `manual.tool()` syntax to avoid naming conflicts
167
+ - **Type Safety**: Get TypeScript interfaces for all tools via `search_tools` or `tool_info`
168
+ - **Code Execution**: Chain multiple tool calls in a single code block
169
+ - **Error Handling**: Proper error handling with timeout support
170
+
171
+ ## 🌟 Features
172
+
173
+ - ✅ **Zero installation** - Works via npx
174
+ - ✅ **Universal compatibility** - Works with any MCP client
175
+ - ✅ **Dynamic configuration** - Update tools without restarting
176
+ - ✅ **Environment isolation** - Each project can have its own config
177
+ - ✅ **Comprehensive tool management** - Register, search, call, and inspect tools
178
+
179
+ ---
180
+
181
+ <img width="2263" height="976" alt="UTCP MCP Bridge Interface" src="https://github.com/user-attachments/assets/a6759512-1c0d-4265-9518-64916fbe1428" />
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env node
2
+ import "@utcp/http";
3
+ import "@utcp/text";
4
+ import "@utcp/mcp";
5
+ import "@utcp/cli";
6
+ import "@utcp/dotenv-loader";
7
+ import "@utcp/file";
8
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":";AAeA,OAAO,YAAY,CAAC;AACpB,OAAO,YAAY,CAAC;AACpB,OAAO,WAAW,CAAC;AACnB,OAAO,WAAW,CAAC;AACnB,OAAO,qBAAqB,CAAA;AAC5B,OAAO,YAAY,CAAA"}
package/dist/index.js ADDED
@@ -0,0 +1,385 @@
1
+ #!/usr/bin/env node
2
+ // UTCP-MCP Bridge Entry Point
3
+ // This is the main entry point for the npx @utcp/mcp-bridge command
4
+ import util from "util";
5
+ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
6
+ import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
7
+ import { z } from "zod";
8
+ import path from "path";
9
+ import { promises as fs } from "fs";
10
+ import { fileURLToPath } from 'url';
11
+ import { dirname } from 'path';
12
+ import "@utcp/http";
13
+ import "@utcp/text";
14
+ import "@utcp/mcp";
15
+ import "@utcp/cli";
16
+ import "@utcp/dotenv-loader";
17
+ import "@utcp/file";
18
+ import { CallTemplateSchema, ensureCorePluginsInitialized, UtcpClientConfigSerializer } from "@utcp/sdk";
19
+ import { CodeModeUtcpClient } from "@utcp/code-mode";
20
+ import { ContentBlockSchema } from "@modelcontextprotocol/sdk/types.js";
21
+ const __filename = fileURLToPath(import.meta.url);
22
+ const __dirname = dirname(__filename);
23
+ // Override info and warn logs in simple manner to keep compatibility with MCP stdio transport
24
+ console.log = (...args) => { process.stderr.write(util.format(...args) + '\n'); };
25
+ console.warn = (...args) => { process.stderr.write(util.format(...args) + '\n'); };
26
+ ensureCorePluginsInitialized();
27
+ let utcpClient = null;
28
+ async function main() {
29
+ setupMcpTools();
30
+ utcpClient = await initializeUtcpClient();
31
+ const transport = new StdioServerTransport();
32
+ await mcp.connect(transport);
33
+ }
34
+ const mcp = new McpServer({
35
+ name: "CodeMode-MCP",
36
+ version: "1.0.0",
37
+ });
38
+ /**
39
+ * Sanitizes an identifier to be a valid TypeScript identifier.
40
+ */
41
+ function sanitizeIdentifier(name) {
42
+ return name
43
+ .replace(/[^a-zA-Z0-9_]/g, '_')
44
+ .replace(/^[0-9]/, '_$&');
45
+ }
46
+ /**
47
+ * Converts a UTCP tool name to its TypeScript interface name.
48
+ */
49
+ function utcpNameToTsInterfaceName(utcpName) {
50
+ if (utcpName.includes('.')) {
51
+ const parts = utcpName.split('.');
52
+ const manualName = parts[0];
53
+ const toolParts = parts.slice(1);
54
+ const sanitizedManualName = sanitizeIdentifier(manualName);
55
+ const toolName = toolParts.map(part => sanitizeIdentifier(part)).join('_');
56
+ return `${sanitizedManualName}.${toolName}`;
57
+ }
58
+ else {
59
+ return sanitizeIdentifier(utcpName);
60
+ }
61
+ }
62
+ /**
63
+ * Finds a tool by either UTCP name or TypeScript interface name.
64
+ */
65
+ async function findToolByName(client, name) {
66
+ // First, try direct lookup by UTCP name
67
+ const directTool = await client.config.tool_repository.getTool(name);
68
+ if (directTool) {
69
+ return { tool: directTool, utcpName: name };
70
+ }
71
+ // If not found, search through all tools to find one whose TS interface name matches
72
+ const allTools = await client.config.tool_repository.getTools();
73
+ for (const tool of allTools) {
74
+ if (utcpNameToTsInterfaceName(tool.name) === name) {
75
+ return { tool, utcpName: tool.name };
76
+ }
77
+ }
78
+ return null;
79
+ }
80
+ function setupMcpTools() {
81
+ // Register MCP prompt for using the code mode server
82
+ mcp.registerPrompt("utcp_codemode_usage", {
83
+ title: "UTCP Code Mode Usage Guide",
84
+ description: "Comprehensive guide on how to use the UTCP Code Mode MCP server for executing TypeScript code with tool access."
85
+ }, async () => {
86
+ const codeInstructions = `# UTCP Code Mode MCP Server Usage Guide
87
+
88
+ You have access to a powerful UTCP Code Mode MCP server that allows you to execute TypeScript code with direct access to registered tools.
89
+
90
+ ## Workflow: Always Follow This Pattern
91
+
92
+ ### 1. 🔍 DISCOVER TOOLS FIRST
93
+ **Always start by searching for relevant tools before writing code:**
94
+ - Use \`search_tools\` with a description of your task to find relevant tools
95
+ - This returns tools with their TypeScript interfaces - study these carefully
96
+ - Use \`tool_info\` to get detailed interface information for specific tools if needed
97
+
98
+ ${CodeModeUtcpClient.AGENT_PROMPT_TEMPLATE}
99
+
100
+ - in the call_tool_chain code, return the result that you want to see, your code will be wrapped in an async function and executed
101
+
102
+ Remember: The power of this system comes from combining multiple tools in sophisticated TypeScript code execution workflows.`;
103
+ return {
104
+ messages: [{
105
+ role: "user",
106
+ content: {
107
+ type: "text",
108
+ text: codeInstructions
109
+ }
110
+ }]
111
+ };
112
+ });
113
+ mcp.registerTool("register_manual", {
114
+ title: "Register a UTCP Manual",
115
+ description: "Registers a new tool provider by providing its call template.",
116
+ inputSchema: { manual_call_template: CallTemplateSchema.describe("The call template for the UTCP Manual endpoint.") },
117
+ }, async (input) => {
118
+ const client = await initializeUtcpClient();
119
+ try {
120
+ const result = await client.registerManual(input.manual_call_template);
121
+ return { content: [{ type: "text", text: JSON.stringify(result) }] };
122
+ }
123
+ catch (e) {
124
+ return { content: [{ type: "text", text: JSON.stringify({ success: false, error: e.message }) }] };
125
+ }
126
+ });
127
+ mcp.registerTool("deregister_manual", {
128
+ title: "Deregister a UTCP Manual",
129
+ description: "Deregisters a tool provider from the UTCP client.",
130
+ inputSchema: { manual_name: z.string().describe("The name of the manual to deregister.") },
131
+ }, async (input) => {
132
+ const client = await initializeUtcpClient();
133
+ try {
134
+ const success = await client.deregisterManual(input.manual_name);
135
+ const message = success ? `Manual '${input.manual_name}' deregistered.` : `Manual '${input.manual_name}' not found.`;
136
+ return { content: [{ type: "text", text: JSON.stringify({ success, message }) }] };
137
+ }
138
+ catch (e) {
139
+ return { content: [{ type: "text", text: JSON.stringify({ success: false, error: e.message }) }] };
140
+ }
141
+ });
142
+ mcp.registerTool("search_tools", {
143
+ title: "Search for UTCP Tools",
144
+ description: "Searches for relevant tools based on a task description.",
145
+ inputSchema: {
146
+ task_description: z.string().describe("A natural language description of the task."),
147
+ limit: z.number().optional().default(10),
148
+ },
149
+ }, async (input) => {
150
+ const client = await initializeUtcpClient();
151
+ try {
152
+ const tools = await client.searchTools(input.task_description, input.limit);
153
+ const toolsWithInterfaces = tools.map(t => ({
154
+ name: utcpNameToTsInterfaceName(t.name),
155
+ description: t.description,
156
+ typescript_interface: client.toolToTypeScriptInterface(t)
157
+ }));
158
+ return { content: [{ type: "text", text: JSON.stringify({ tools: toolsWithInterfaces }) }] };
159
+ }
160
+ catch (e) {
161
+ return { isError: true, content: [{ type: "text", text: JSON.stringify({ error: e.message }) }] };
162
+ }
163
+ });
164
+ mcp.registerTool("list_tools", {
165
+ title: "List All Registered UTCP Tools",
166
+ description: "Returns a list of all tool names currently registered.",
167
+ inputSchema: {},
168
+ }, async () => {
169
+ const client = await initializeUtcpClient();
170
+ try {
171
+ const tools = await client.config.tool_repository.getTools();
172
+ const toolNames = tools.map(t => utcpNameToTsInterfaceName(t.name));
173
+ return { content: [{ type: "text", text: JSON.stringify({ tools: toolNames }) }] };
174
+ }
175
+ catch (e) {
176
+ return { isError: true, content: [{ type: "text", text: e.message }] };
177
+ }
178
+ });
179
+ mcp.registerTool("get_required_keys_for_tool", {
180
+ title: "Get Required Variables for Tool",
181
+ description: "Get required environment variables for a registered tool.",
182
+ inputSchema: {
183
+ tool_name: z.string().describe("Name of the tool to get required variables for."),
184
+ },
185
+ }, async (input) => {
186
+ const client = await initializeUtcpClient();
187
+ try {
188
+ const found = await findToolByName(client, input.tool_name);
189
+ if (!found) {
190
+ return { isError: true, content: [{ type: "text", text: `Tool '${input.tool_name}' not found` }] };
191
+ }
192
+ const variables = await client.getRequiredVariablesForRegisteredTool(found.utcpName);
193
+ return { content: [{ type: "text", text: JSON.stringify({ success: true, tool_name: input.tool_name, required_variables: variables }) }] };
194
+ }
195
+ catch (e) {
196
+ return { isError: true, content: [{ type: "text", text: JSON.stringify({ tool_name: input.tool_name, error: e.message }) }] };
197
+ }
198
+ });
199
+ mcp.registerTool("tools_info", {
200
+ title: "Get Tools Information with TypeScript Interface",
201
+ description: "Get complete information about a specified list of tools, including TypeScript interface definition.",
202
+ inputSchema: {
203
+ tool_names: z.array(z.string()).describe("Names of the tools to get complete information for."),
204
+ },
205
+ }, async (input) => {
206
+ const client = await initializeUtcpClient();
207
+ try {
208
+ const typescriptInterfaces = [];
209
+ const infos = [];
210
+ for (const name of input.tool_names) {
211
+ const found = await findToolByName(client, name);
212
+ if (found) {
213
+ typescriptInterfaces.push(client.toolToTypeScriptInterface(found.tool));
214
+ }
215
+ else {
216
+ infos.push(`// Tool '${name}' not found`);
217
+ }
218
+ }
219
+ if (typescriptInterfaces.length === 0 && infos.length > 0) {
220
+ return { isError: true, content: [{ type: "text", text: infos.join("\n\n") }] };
221
+ }
222
+ else {
223
+ let fullContent = typescriptInterfaces.join("\n\n");
224
+ if (infos.length > 0) {
225
+ fullContent += "\n\n" + infos.join("\n");
226
+ }
227
+ return { content: [{ type: "text", text: fullContent }] };
228
+ }
229
+ }
230
+ catch (e) {
231
+ return { isError: true, content: [{ type: "text", text: e.message }] };
232
+ }
233
+ });
234
+ // Code Mode specific tools
235
+ mcp.registerTool("call_tool_chain", {
236
+ title: "Execute TypeScript Code with Tool Access",
237
+ description: "Execute TypeScript code with direct access to all registered tools as hierarchical functions (e.g., manual.tool()).",
238
+ inputSchema: {
239
+ code: z.string().describe("TypeScript code to execute with access to all registered tools."),
240
+ timeout: z.number().optional().default(30000).describe("Optional timeout in milliseconds (default: 30000)."),
241
+ max_output_size: z.number().optional().default(200000).describe("Optional maximum output size in characters (default: 200000)."),
242
+ },
243
+ }, async (input) => {
244
+ const client = await initializeUtcpClient();
245
+ try {
246
+ const { result, logs } = await client.callToolChain(input.code, input.timeout);
247
+ function truncateText(text) {
248
+ if (text.length <= input.max_output_size) {
249
+ return text;
250
+ }
251
+ return text.slice(0, input.max_output_size) + "...\nmax_output_size exceeded";
252
+ }
253
+ let content = new Array();
254
+ let processedResult = new Array();
255
+ // Handle MCP response content blocks
256
+ // Based on logic from McpCommunicationProtocol._processMcpToolResult
257
+ let mcpContentFound = false;
258
+ // Case 1: content blocks passed as an array (when more than one)
259
+ if (Array.isArray(result)) {
260
+ for (const item of result) {
261
+ if (ContentBlockSchema.safeParse(item).success) {
262
+ content.push(item);
263
+ mcpContentFound = true;
264
+ }
265
+ else {
266
+ // Text blocks are returned as plain object or string
267
+ processedResult.push(item);
268
+ }
269
+ }
270
+ // Case 2: when a single content block is returned, it passed directly
271
+ }
272
+ else if (ContentBlockSchema.safeParse(result).success) {
273
+ content.push(result);
274
+ mcpContentFound = true;
275
+ // Case 3: result is not a content block - it's either text or structured data or not MCP content at all
276
+ }
277
+ else {
278
+ processedResult.push(result);
279
+ }
280
+ const plainContent = processedResult.length > 1 ? processedResult : processedResult[0];
281
+ const jsonContent = JSON.stringify({ success: true, nonMcpContentResults: plainContent, logs });
282
+ content.push({ type: "text", text: truncateText(jsonContent) });
283
+ return { content: content };
284
+ }
285
+ catch (e) {
286
+ return { isError: true, content: [{ type: "text", text: e.message }] };
287
+ }
288
+ });
289
+ }
290
+ /**
291
+ * Checks if a string is a valid HTTP/HTTPS URL
292
+ */
293
+ function isUrl(str) {
294
+ try {
295
+ const url = new URL(str);
296
+ return url.protocol === 'http:' || url.protocol === 'https:';
297
+ }
298
+ catch {
299
+ return false;
300
+ }
301
+ }
302
+ /**
303
+ * Fetches configuration from a remote URL
304
+ */
305
+ async function fetchRemoteConfig(url) {
306
+ console.log(`Fetching remote config from: ${url}`);
307
+ const response = await fetch(url);
308
+ if (!response.ok) {
309
+ throw new Error(`Failed to fetch remote config: ${response.status} ${response.statusText}`);
310
+ }
311
+ const contentType = response.headers.get('content-type');
312
+ if (!contentType?.includes('application/json')) {
313
+ console.warn(`Warning: Remote config URL returned content-type '${contentType}', expected 'application/json'`);
314
+ }
315
+ return await response.json();
316
+ }
317
+ async function initializeUtcpClient() {
318
+ if (utcpClient) {
319
+ return utcpClient;
320
+ }
321
+ // Look for config file: 1) Environment variable, 2) Current working directory, 3) Package directory
322
+ const cwd = process.cwd();
323
+ const packageDir = __dirname;
324
+ let configPath;
325
+ let scriptDir;
326
+ let isRemote = false;
327
+ // Check if UTCP_CONFIG_FILE environment variable is set
328
+ if (process.env.UTCP_CONFIG_FILE) {
329
+ configPath = process.env.UTCP_CONFIG_FILE;
330
+ isRemote = isUrl(configPath);
331
+ if (!isRemote) {
332
+ configPath = path.resolve(configPath);
333
+ scriptDir = path.dirname(configPath);
334
+ try {
335
+ await fs.access(configPath);
336
+ }
337
+ catch {
338
+ console.warn(`UTCP config file specified in UTCP_CONFIG_FILE not found: ${configPath}`);
339
+ }
340
+ }
341
+ else {
342
+ // For remote configs, use current working directory as script dir
343
+ scriptDir = cwd;
344
+ }
345
+ }
346
+ else {
347
+ // Fall back to current working directory first, then package directory
348
+ configPath = path.resolve(cwd, '.utcp_config.json');
349
+ scriptDir = cwd;
350
+ try {
351
+ await fs.access(configPath);
352
+ }
353
+ catch {
354
+ configPath = path.resolve(packageDir, '.utcp_config.json');
355
+ scriptDir = packageDir;
356
+ }
357
+ }
358
+ let rawConfig = {};
359
+ try {
360
+ let configFileContent;
361
+ if (isRemote) {
362
+ // Fetch from remote URL
363
+ rawConfig = await fetchRemoteConfig(configPath);
364
+ }
365
+ else {
366
+ // Read from local file
367
+ configFileContent = await fs.readFile(configPath, 'utf-8');
368
+ rawConfig = JSON.parse(configFileContent);
369
+ }
370
+ }
371
+ catch (e) {
372
+ if (e.code !== 'ENOENT') {
373
+ console.warn(`Could not read or parse config file. Error: ${e.message}`);
374
+ }
375
+ }
376
+ const clientConfig = new UtcpClientConfigSerializer().validateDict(rawConfig);
377
+ const newClient = await CodeModeUtcpClient.create(scriptDir, clientConfig);
378
+ utcpClient = newClient;
379
+ return utcpClient;
380
+ }
381
+ main().catch(err => {
382
+ console.error("Failed to start UTCP-MCP Bridge:", err);
383
+ process.exit(1);
384
+ });
385
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":";AAEA,8BAA8B;AAC9B,oEAAoE;AAEpE,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,QAAQ,IAAI,EAAE,EAAE,MAAM,IAAI,CAAC;AAEpC,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AACpC,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAE/B,OAAO,YAAY,CAAC;AACpB,OAAO,YAAY,CAAC;AACpB,OAAO,WAAW,CAAC;AACnB,OAAO,WAAW,CAAC;AACnB,OAAO,qBAAqB,CAAA;AAC5B,OAAO,YAAY,CAAA;AAEnB,OAAO,EAEH,kBAAkB,EAIlB,4BAA4B,EAC5B,0BAA0B,EAC7B,MAAM,WAAW,CAAC;AAEnB,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,EAAgB,kBAAkB,EAAE,MAAM,oCAAoC,CAAC;AAEtF,MAAM,UAAU,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAClD,MAAM,SAAS,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;AAEtC,8FAA8F;AAC9F,OAAO,CAAC,GAAG,GAAG,CAAC,GAAG,IAAW,EAAE,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC,GAAG,I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rajendiran/code-mode-mcp",
3
+ "version": "1.2.1",
4
+ "description": "Model Context Protocol (MCP) server for UTCP Code Mode - Execute TypeScript code with direct tool access (Fork with remote config support)",
5
+ "type": "module",
6
+ "main": "dist/index.js",
7
+ "bin": {
8
+ "mcp-bridge": "./dist/index.js"
9
+ },
10
+ "files": [
11
+ "dist/**/*",
12
+ "README.md"
13
+ ],
14
+ "scripts": {
15
+ "build": "node --max-old-space-size=8192 ./node_modules/typescript/bin/tsc",
16
+ "prepublishOnly": "npm run build",
17
+ "start": "node dist/index.js"
18
+ },
19
+ "keywords": [
20
+ "utcp",
21
+ "mcp",
22
+ "code-mode",
23
+ "typescript",
24
+ "model-context-protocol",
25
+ "universal-tool-calling-protocol",
26
+ "bridge",
27
+ "tools",
28
+ "ai",
29
+ "code-execution",
30
+ "remote-config"
31
+ ],
32
+ "author": "Sriram Rajendiran",
33
+ "license": "MIT",
34
+ "repository": {
35
+ "type": "git",
36
+ "url": "https://github.com/sriramrajendiran/code-mode.git"
37
+ },
38
+ "homepage": "https://github.com/sriramrajendiran/code-mode#readme",
39
+ "bugs": {
40
+ "url": "https://github.com/sriramrajendiran/code-mode/issues"
41
+ },
42
+ "engines": {
43
+ "node": ">=18.0.0"
44
+ },
45
+ "publishConfig": {
46
+ "access": "public"
47
+ },
48
+ "devDependencies": {
49
+ "@types/node": "^20.0.0",
50
+ "typescript": "^5.0.0"
51
+ },
52
+ "dependencies": {
53
+ "@modelcontextprotocol/sdk": "^1.20.2",
54
+ "@utcp/cli": "^1.1.0",
55
+ "@utcp/code-mode": "^1.2.11",
56
+ "@utcp/dotenv-loader": "^1.1.0",
57
+ "@utcp/file": "^1.1.0",
58
+ "@utcp/http": "^1.1.0",
59
+ "@utcp/mcp": "^1.1.1",
60
+ "@utcp/sdk": "^1.1.0",
61
+ "@utcp/text": "^1.1.0",
62
+ "dotenv": "^16.0.0",
63
+ "zod": "^3.22.0"
64
+ }
65
+ }