Skip to content
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions .tool-versions
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
nodejs 22.13.1
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ Options can be passed as a comma-separated list in the `YEPCODE_MCP_OPTIONS` env
{
"mcpServers": {
"yepcode-mcp-server": {
"url": "https://cloud.yepcode.io/mcp/sk-c2E....RD/sse?mcpOptions=disableRunCodeTool,skipRunCodeCleanup"
"url": "https://cloud.yepcode.io/mcp/sk-c2E....RD/sse?mcpOptions=disableRunCodeTool,runCodeCleanup"
}
}
}
Expand All @@ -171,7 +171,7 @@ Options can be passed as a comma-separated list in the `YEPCODE_MCP_OPTIONS` env
"args": ["-y", "@yepcode/mcp-server"],
"env": {
"YEPCODE_API_TOKEN": "your_api_token_here",
"YEPCODE_MCP_OPTIONS": "disableRunCodeTool,skipRunCodeCleanup"
"YEPCODE_MCP_OPTIONS": "disableRunCodeTool,runCodeCleanup"
}
}
}
Expand Down
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,11 @@
"dev": "node --loader ts-node/esm src/index.ts",
"build": "tsc && node -e \"require('fs').chmodSync('dist/index.js', '755')\"",
"type-check": "tsc --noEmit",
"inspector": "npx @modelcontextprotocol/inspector dist/index.js"
"inspector": "npx @modelcontextprotocol/inspector node --env-file=.env dist/index.js"
},
"dependencies": {
"@modelcontextprotocol/sdk": "^1.12.1",
"@yepcode/run": "^1.3.0",
"@yepcode/run": "^1.4.1",
"dotenv": "^16.4.7",
"zod": "^3.24.2"
},
Expand Down
6 changes: 3 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ const logger = new Logger("StdioServer", { logsToStderr: true });

const main = async (): Promise<void> => {
let disableRunCodeTool = false;
let skipRunCodeCleanup = false;
let runCodeCleanup = false;
if (process.env.YEPCODE_MCP_OPTIONS) {
const mcpOptions = process.env.YEPCODE_MCP_OPTIONS.split(",");
disableRunCodeTool = mcpOptions.includes("disableRunCodeTool");
skipRunCodeCleanup = mcpOptions.includes("skipRunCodeCleanup");
runCodeCleanup = mcpOptions.includes("runCodeCleanup");
}
const server = new YepCodeMcpServer(
{},
{ logsToStderr: true, disableRunCodeTool, skipRunCodeCleanup }
{ logsToStderr: true, disableRunCodeTool, runCodeCleanup }
);
try {
const transport = new StdioServerTransport();
Expand Down
10 changes: 5 additions & 5 deletions src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,17 +44,17 @@ class YepCodeMcpServer extends Server {
private yepCodeApi: YepCodeApi;
private logger: Logger;
private disableRunCodeTool: boolean;
private skipRunCodeCleanup: boolean;
private runCodeCleanup: boolean;
constructor(
config: YepCodeApiConfig,
{
logsToStderr = false,
disableRunCodeTool = false,
skipRunCodeCleanup = false,
runCodeCleanup = false,
}: {
logsToStderr?: boolean;
disableRunCodeTool?: boolean;
skipRunCodeCleanup?: boolean;
runCodeCleanup?: boolean;
} = {}
) {
super(
Expand All @@ -72,7 +72,7 @@ class YepCodeMcpServer extends Server {
);

this.disableRunCodeTool = disableRunCodeTool;
this.skipRunCodeCleanup = skipRunCodeCleanup;
this.runCodeCleanup = runCodeCleanup;
this.setupHandlers();
this.setupErrorHandling();

Expand Down Expand Up @@ -351,7 +351,7 @@ Tip: First try to find a tool that matches your task, but if not available, try
});

const execution = await this.yepCodeRun.run(code, {
removeOnDone: !this.skipRunCodeCleanup,
removeOnDone: this.runCodeCleanup,
...options,
initiatedBy: "@yepcode/mcp-server",
onLog: (log) => {
Expand Down