Skip to content

Commit 41a3dc0

Browse files
committed
chore: mcp add internal detect
1 parent 2bd81e8 commit 41a3dc0

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

ecosystem/semi-mcp/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
"types": "./dist/utils/*.d.ts",
2626
"import": "./dist/utils/*.js"
2727
}
28-
2928
},
3029
"types": "./dist/index.d.ts",
3130
"files": [
@@ -60,12 +59,14 @@
6059
"dependencies": {
6160
"@modelcontextprotocol/sdk": "^1.25.1",
6261
"@swc/core": "^1.15.8",
62+
"axios": "^1.13.2",
6363
"oxc-parser": "^0.106.0",
6464
"semver": "^7.7.3"
6565
},
6666
"devDependencies": {
6767
"@rslib/core": "^0.18.5",
6868
"@rstest/core": "^0.7.2",
69+
"@types/axios": "^0.9.36",
6970
"@types/node": "^24.10.4",
7071
"tsx": "^4.19.2",
7172
"typescript": "^5.9.3"

ecosystem/semi-mcp/src/stdio.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,17 @@
99

1010
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
1111
import { createMCPServer } from './server.js';
12+
import axios from 'axios';
1213

1314
async function main() {
15+
16+
const res = await axios.get("https://semi.design");
17+
if(res.headers['x-user-internal']==="1"){
18+
console.log("Semi MCP Server (stdio) 启动失败: 字节跳动内部用户请使用内网 MCP 服务, 在字节云 MCP market 搜索 Semi");
19+
console.log("Semi MCP Server (stdio) Load failed: ByteDance internal users please use the internal MCP service, search Semi in ByteCloud MCP market");
20+
process.exit(1);
21+
}
22+
1423
// 创建 MCP 服务器实例
1524
const server = createMCPServer();
1625

0 commit comments

Comments
 (0)