@lofter-admin/mcp-backend 0.1.0 → 0.1.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 CHANGED
@@ -10,27 +10,15 @@
10
10
 
11
11
  ### stdio 模式(本地集成)
12
12
 
13
- `~/.config/codemaker/codemaker.json` 的 `mcp` 字段中添加:
13
+ `.mcp.json` 的 `mcp` 字段中添加:
14
14
 
15
15
  ```json
16
- {
17
- "mcp": {
18
- "LOFTER-admin": {
19
- "type": "local",
20
- "command": [
21
- "npx",
22
- "@lofter-admin/mcp-backend",
23
- "start",
24
- "-t",
25
- "stdio"
26
- ],
27
- "enabled": true,
28
- "environment": {
29
- "LOFTER_ADMIN_SECRET": "<你的密钥>"
30
- },
31
- "timeout": 60000
32
- }
33
- }
16
+ "LOFTER-admin": {
17
+ "type": "stdio",
18
+ "command": "pnpx",
19
+ "args": ["@lofter-admin/mcp-backend", "start", "-t", "stdio"],
20
+ "enabled": true,
21
+ "timeout": 60000
34
22
  }
35
23
  ```
36
24
 
package/dist/cli.js CHANGED
@@ -1,10 +1,19 @@
1
1
  #!/usr/bin/env node
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
2
11
  import { Command } from 'commander';
3
12
  import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
4
13
  import { StreamableHTTPServerTransport } from '@modelcontextprotocol/sdk/server/streamableHttp.js';
5
14
  import { createServer } from 'node:http';
6
- import { createMcpServer } from './server';
7
- import { requestContext } from './context';
15
+ import { createMcpServer } from './server.js';
16
+ import { requestContext } from './context.js';
8
17
  const program = new Command();
9
18
  program
10
19
  .name('lofter-mcp')
@@ -16,63 +25,67 @@ program
16
25
  .option('-t, --transport <type>', 'transport 类型: stdio | http', 'stdio')
17
26
  .option('-p, --port <number>', 'HTTP 模式监听端口(仅 --transport http 时有效)', '3000')
18
27
  .option('-b, --base-url <url>', '后台服务 BASE URL,也可通过 LOFTER_BASE_URL 环境变量设置')
19
- .action(async (options) => {
28
+ .action((options) => __awaiter(void 0, void 0, void 0, function* () {
20
29
  const { transport, port, baseUrl } = options;
21
30
  if (transport === 'stdio') {
22
- await startStdio();
31
+ yield startStdio();
23
32
  }
24
33
  else if (transport === 'http') {
25
- await startHttp(parseInt(port, 10), baseUrl);
34
+ yield startHttp(parseInt(port, 10), baseUrl);
26
35
  }
27
36
  else {
28
37
  process.stderr.write(`未知的 transport 类型: ${transport},支持 stdio | http\n`);
29
38
  process.exit(1);
30
39
  }
31
- });
40
+ }));
32
41
  program.parse();
33
- async function startStdio() {
34
- const server = createMcpServer();
35
- const transport = new StdioServerTransport();
36
- await server.connect(transport);
37
- // stdio 模式下避免向 stdout 写入非协议内容
38
- process.stderr.write('[lofter-mcp] stdio 模式已启动\n');
42
+ function startStdio() {
43
+ return __awaiter(this, void 0, void 0, function* () {
44
+ const server = createMcpServer();
45
+ const transport = new StdioServerTransport();
46
+ yield server.connect(transport);
47
+ // stdio 模式下避免向 stdout 写入非协议内容
48
+ process.stderr.write('[lofter-mcp] stdio 模式已启动\n');
49
+ });
39
50
  }
40
51
  const MCP_ENDPOINT = '/mcp';
41
52
  const ALLOWED_METHODS = new Set(['GET', 'POST', 'DELETE']);
42
- async function startHttp(port, baseUrl) {
43
- const httpServer = createServer(async (req, res) => {
44
- // MCP v2 (2025-03-26) Streamable HTTP: 所有请求集中在单一 MCP endpoint
45
- // POST /mcp - 发送 JSON-RPC 消息(requests / notifications / responses)
46
- // GET /mcp - 建立 SSE 流,接收服务端推送
47
- // DELETE /mcp - 显式终止 session(stateful 模式)
48
- const url = new URL(req.url ?? '/', `http://localhost:${port}`);
49
- const method = req.method ?? '';
50
- if (url.pathname !== MCP_ENDPOINT) {
51
- res.writeHead(404, { 'Content-Type': 'application/json' });
52
- res.end(JSON.stringify({ error: `Not Found. MCP endpoint is ${MCP_ENDPOINT}` }));
53
- return;
54
- }
55
- if (!ALLOWED_METHODS.has(method)) {
56
- res.writeHead(405, {
57
- 'Content-Type': 'application/json',
58
- Allow: 'GET, POST, DELETE',
59
- });
60
- res.end(JSON.stringify({ error: 'Method Not Allowed' }));
61
- return;
62
- }
63
- const rawSecret = req.headers['lofter-admin-secret'];
64
- const secret = typeof rawSecret === 'string' ? rawSecret : undefined;
65
- const server = createMcpServer();
66
- const transport = new StreamableHTTPServerTransport({ sessionIdGenerator: undefined });
67
- await server.connect(transport);
68
- await requestContext.run({ secret, baseUrl }, () => transport.handleRequest(req, res));
69
- });
70
- httpServer.listen(port, () => {
71
- console.log(`[lofter-mcp] HTTP MCP Server 已启动,端口: ${port}`);
72
- console.log(`[lofter-mcp] MCP endpoint: http://localhost:${port}${MCP_ENDPOINT}`);
73
- console.log(`[lofter-mcp] POST ${MCP_ENDPOINT} - 发送 JSON-RPC 消息`);
74
- console.log(`[lofter-mcp] GET ${MCP_ENDPOINT} - 建立 SSE 推送流`);
75
- console.log(`[lofter-mcp] DELETE ${MCP_ENDPOINT} - 终止 session`);
53
+ function startHttp(port, baseUrl) {
54
+ return __awaiter(this, void 0, void 0, function* () {
55
+ const httpServer = createServer((req, res) => __awaiter(this, void 0, void 0, function* () {
56
+ var _a, _b;
57
+ // MCP v2 (2025-03-26) Streamable HTTP: 所有请求集中在单一 MCP endpoint
58
+ // POST /mcp - 发送 JSON-RPC 消息(requests / notifications / responses)
59
+ // GET /mcp - 建立 SSE 流,接收服务端推送
60
+ // DELETE /mcp - 显式终止 session(stateful 模式)
61
+ const url = new URL((_a = req.url) !== null && _a !== void 0 ? _a : '/', `http://localhost:${port}`);
62
+ const method = (_b = req.method) !== null && _b !== void 0 ? _b : '';
63
+ if (url.pathname !== MCP_ENDPOINT) {
64
+ res.writeHead(404, { 'Content-Type': 'application/json' });
65
+ res.end(JSON.stringify({ error: `Not Found. MCP endpoint is ${MCP_ENDPOINT}` }));
66
+ return;
67
+ }
68
+ if (!ALLOWED_METHODS.has(method)) {
69
+ res.writeHead(405, {
70
+ 'Content-Type': 'application/json',
71
+ Allow: 'GET, POST, DELETE',
72
+ });
73
+ res.end(JSON.stringify({ error: 'Method Not Allowed' }));
74
+ return;
75
+ }
76
+ const rawSecret = req.headers['lofter-admin-secret'];
77
+ const secret = typeof rawSecret === 'string' ? rawSecret : undefined;
78
+ const server = createMcpServer();
79
+ const transport = new StreamableHTTPServerTransport({ sessionIdGenerator: undefined });
80
+ yield server.connect(transport);
81
+ yield requestContext.run({ secret, baseUrl }, () => transport.handleRequest(req, res));
82
+ }));
83
+ httpServer.listen(port, () => {
84
+ console.log(`[lofter-mcp] HTTP MCP Server 已启动,端口: ${port}`);
85
+ console.log(`[lofter-mcp] MCP endpoint: http://localhost:${port}${MCP_ENDPOINT}`);
86
+ console.log(`[lofter-mcp] POST ${MCP_ENDPOINT} - 发送 JSON-RPC 消息`);
87
+ console.log(`[lofter-mcp] GET ${MCP_ENDPOINT} - 建立 SSE 推送流`);
88
+ console.log(`[lofter-mcp] DELETE ${MCP_ENDPOINT} - 终止 session`);
89
+ });
76
90
  });
77
91
  }
78
- //# sourceMappingURL=cli.js.map
package/dist/context.js CHANGED
@@ -11,20 +11,21 @@ function getSecretFromUserConfig() {
11
11
  const configs = JSON.parse(configStr);
12
12
  return configs.secret;
13
13
  }
14
- catch {
14
+ catch (_a) {
15
15
  return undefined;
16
16
  }
17
17
  }
18
18
  export function getSecret() {
19
+ var _a, _b;
19
20
  const ctx = requestContext.getStore();
20
- const secret = ctx?.secret ?? process.env.LOFTER_ADMIN_SECRET ?? getSecretFromUserConfig();
21
+ const secret = (_b = (_a = ctx === null || ctx === void 0 ? void 0 : ctx.secret) !== null && _a !== void 0 ? _a : process.env.LOFTER_ADMIN_SECRET) !== null && _b !== void 0 ? _b : getSecretFromUserConfig();
21
22
  if (!secret) {
22
23
  throw new Error('LOFTER_ADMIN_SECRET 未设置(请求 header、环境变量或 ~/.lofter-micro/config 中的 secret)');
23
24
  }
24
25
  return secret;
25
26
  }
26
27
  export function getBaseUrl() {
28
+ var _a, _b;
27
29
  const ctx = requestContext.getStore();
28
- return ctx?.baseUrl ?? process.env.LOFTER_BASE_URL ?? DEFAULT_BASE_URL;
30
+ return (_b = (_a = ctx === null || ctx === void 0 ? void 0 : ctx.baseUrl) !== null && _a !== void 0 ? _a : process.env.LOFTER_BASE_URL) !== null && _b !== void 0 ? _b : DEFAULT_BASE_URL;
29
31
  }
30
- //# sourceMappingURL=context.js.map
@@ -1,19 +1,29 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
1
10
  import axios from 'axios';
2
- import { getSecret, getBaseUrl } from './context';
3
- const DEFAULT_TIMEOUT = 30_000;
4
- export async function httpGet(path, options = {}) {
5
- const { withAuth = false, timeout = DEFAULT_TIMEOUT, params } = options;
6
- const config = {
7
- method: 'GET',
8
- url: `${getBaseUrl()}${path}`,
9
- timeout,
10
- params,
11
- headers: {},
12
- };
13
- if (withAuth) {
14
- config.headers['lofter-micro-secret'] = getSecret();
15
- }
16
- const response = await axios.request(config);
17
- return response.data;
11
+ import { getSecret, getBaseUrl } from './context.js';
12
+ const DEFAULT_TIMEOUT = 30000;
13
+ export function httpGet(path_1) {
14
+ return __awaiter(this, arguments, void 0, function* (path, options = {}) {
15
+ const { withAuth = false, timeout = DEFAULT_TIMEOUT, params } = options;
16
+ const config = {
17
+ method: 'GET',
18
+ url: `${getBaseUrl()}${path}`,
19
+ timeout,
20
+ params,
21
+ headers: {},
22
+ };
23
+ if (withAuth) {
24
+ config.headers['lofter-micro-secret'] = getSecret();
25
+ }
26
+ const response = yield axios.request(config);
27
+ return response.data;
28
+ });
18
29
  }
19
- //# sourceMappingURL=http-client.js.map
package/dist/server.js CHANGED
@@ -1,18 +1,27 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
1
10
  import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
11
  import { StreamableHTTPServerTransport } from '@modelcontextprotocol/sdk/server/streamableHttp.js';
3
12
  import { z } from 'zod';
4
- import { requestContext } from './context';
5
- import { checkConnection } from './tools/check-connection';
6
- import { listMicroApps } from './tools/list-micro-apps';
7
- import { commonRequest } from './tools/common/request';
13
+ import { requestContext } from './context.js';
14
+ import { checkConnection } from './tools/check-connection.js';
15
+ import { listMicroApps } from './tools/list-micro-apps.js';
16
+ import { commonRequest } from './tools/common/request.js';
8
17
  export function createMcpServer() {
9
18
  const server = new McpServer({
10
19
  name: 'lofter-admin-mcp',
11
20
  version: '0.1.0',
12
21
  });
13
22
  // Tool: check_connection
14
- server.tool('check_connection', '测试与 LOFTER 管理后台的连接是否正常', {}, async () => {
15
- const result = await checkConnection();
23
+ server.tool('check_connection', '测试与 LOFTER 管理后台的连接是否正常', {}, () => __awaiter(this, void 0, void 0, function* () {
24
+ const result = yield checkConnection();
16
25
  return {
17
26
  content: [
18
27
  {
@@ -21,11 +30,11 @@ export function createMcpServer() {
21
30
  },
22
31
  ],
23
32
  };
24
- });
33
+ }));
25
34
  // Tool: list_micro_apps
26
- server.tool('list_micro_apps', '获取 LOFTER 管理后台所有子应用的配置信息,包括主应用信息和子应用列表', {}, async () => {
35
+ server.tool('list_micro_apps', '获取 LOFTER 管理后台所有子应用的配置信息,包括主应用信息和子应用列表', {}, () => __awaiter(this, void 0, void 0, function* () {
27
36
  try {
28
- const result = await listMicroApps();
37
+ const result = yield listMicroApps();
29
38
  return {
30
39
  content: [
31
40
  {
@@ -47,7 +56,7 @@ export function createMcpServer() {
47
56
  isError: true,
48
57
  };
49
58
  }
50
- });
59
+ }));
51
60
  // Tool: common_request
52
61
  server.tool('common_request', '通用 HTTP 请求工具,转发至 LOFTER 管理后台接口,支持 GET/POST/PUT/DELETE 及多种请求体格式', {
53
62
  functionDomain: z.enum(['api', 'platform']).optional().describe('功能域:api = 业务数据(/api/*),platform = 应用管理(/platform/*),默认 api'),
@@ -61,9 +70,9 @@ export function createMcpServer() {
61
70
  json: z.record(z.unknown()).optional().describe('JSON 请求体,自动设置 Content-Type: application/json'),
62
71
  text: z.string().optional().describe('文本请求体'),
63
72
  buffer: z.string().optional().describe('二进制请求体,Base64 编码字符串'),
64
- }, async (params) => {
73
+ }, (params) => __awaiter(this, void 0, void 0, function* () {
65
74
  try {
66
- const result = await commonRequest(params);
75
+ const result = yield commonRequest(params);
67
76
  return {
68
77
  content: [{ type: 'text', text: JSON.stringify(result, null, 2) }],
69
78
  };
@@ -75,16 +84,17 @@ export function createMcpServer() {
75
84
  isError: true,
76
85
  };
77
86
  }
78
- });
87
+ }));
79
88
  return server;
80
89
  }
81
- export async function createMcpRequestHandler(options) {
82
- return async (req, res) => {
83
- const secret = req.headers['lofter-micro-secret'];
84
- const server = createMcpServer();
85
- const transport = new StreamableHTTPServerTransport({ sessionIdGenerator: undefined });
86
- await server.connect(transport);
87
- return requestContext.run({ secret, baseUrl: options?.baseUrl }, () => transport.handleRequest(req, res));
88
- };
90
+ export function createMcpRequestHandler(options) {
91
+ return __awaiter(this, void 0, void 0, function* () {
92
+ return (req, res) => __awaiter(this, void 0, void 0, function* () {
93
+ const secret = req.headers['lofter-micro-secret'];
94
+ const server = createMcpServer();
95
+ const transport = new StreamableHTTPServerTransport({ sessionIdGenerator: undefined });
96
+ yield server.connect(transport);
97
+ return requestContext.run({ secret, baseUrl: options === null || options === void 0 ? void 0 : options.baseUrl }, () => transport.handleRequest(req, res));
98
+ });
99
+ });
89
100
  }
90
- //# sourceMappingURL=server.js.map
@@ -1,19 +1,29 @@
1
- import { httpGet } from '../http-client';
2
- export async function checkConnection() {
3
- try {
4
- const data = await httpGet('/health/check', {
5
- withAuth: false,
6
- timeout: 5_000,
7
- });
8
- const body = typeof data === 'string' ? data.trim() : String(data);
9
- if (body === '200') {
10
- return { connected: true, message: '连接正常' };
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ import { httpGet } from '../http-client.js';
11
+ export function checkConnection() {
12
+ return __awaiter(this, void 0, void 0, function* () {
13
+ try {
14
+ const data = yield httpGet('/health/check', {
15
+ withAuth: false,
16
+ timeout: 5000,
17
+ });
18
+ const body = typeof data === 'string' ? data.trim() : String(data);
19
+ if (body === '200') {
20
+ return { connected: true, message: '连接正常' };
21
+ }
22
+ return { connected: false, message: `服务返回异常内容: ${body}` };
11
23
  }
12
- return { connected: false, message: `服务返回异常内容: ${body}` };
13
- }
14
- catch (err) {
15
- const message = err instanceof Error ? err.message : String(err);
16
- return { connected: false, message: `连接失败: ${message}` };
17
- }
24
+ catch (err) {
25
+ const message = err instanceof Error ? err.message : String(err);
26
+ return { connected: false, message: `连接失败: ${message}` };
27
+ }
28
+ });
18
29
  }
19
- //# sourceMappingURL=check-connection.js.map
@@ -1,58 +1,67 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
1
10
  import axios from 'axios';
2
- import { getSecret, getBaseUrl } from '../../context';
3
- const DEFAULT_TIMEOUT = 10_000;
4
- async function makeRequest(params) {
5
- const { functionDomain = 'api', functionName, method, headers = {}, timeout = DEFAULT_TIMEOUT, responseType = 'json', query, formData, json, text, buffer, } = params;
6
- const url = `${getBaseUrl()}/${functionDomain}/${functionName}`;
7
- // 构建请求头
8
- const requestHeaders = {
9
- 'lofter-micro-secret': getSecret(),
10
- ...headers,
11
- };
12
- // 构建请求体
13
- let data;
14
- if (formData !== undefined) {
15
- requestHeaders['Content-Type'] = 'application/x-www-form-urlencoded';
16
- data = new URLSearchParams(Object.entries(formData).map(([k, v]) => [k, String(v)])).toString();
17
- }
18
- else if (json !== undefined) {
19
- requestHeaders['Content-Type'] = 'application/json';
20
- data = json;
21
- }
22
- else if (text !== undefined) {
23
- data = text;
24
- }
25
- else if (buffer !== undefined) {
26
- data = Buffer.from(buffer, 'base64');
27
- }
28
- // axios responseType 映射
29
- const axiosResponseType = responseType === 'buffer' ? 'arraybuffer' : responseType;
30
- const config = {
31
- method: method.toUpperCase(),
32
- url,
33
- timeout,
34
- params: query,
35
- headers: requestHeaders,
36
- data,
37
- responseType: axiosResponseType,
38
- };
39
- const response = await axios.request(config);
40
- // 处理响应数据
41
- let responseData;
42
- if (responseType === 'buffer') {
43
- // arraybuffer 转 Base64 字符串返回
44
- responseData = Buffer.from(response.data).toString('base64');
45
- }
46
- else {
47
- responseData = response.data;
48
- }
49
- return {
50
- status: response.status,
51
- headers: response.headers,
52
- data: responseData,
53
- };
11
+ import { getSecret, getBaseUrl } from '../../context.js';
12
+ const DEFAULT_TIMEOUT = 10000;
13
+ function makeRequest(params) {
14
+ return __awaiter(this, void 0, void 0, function* () {
15
+ const { functionDomain = 'api', functionName, method, headers = {}, timeout = DEFAULT_TIMEOUT, responseType = 'json', query, formData, json, text, buffer, } = params;
16
+ const url = `${getBaseUrl()}/${functionDomain}/${functionName}`;
17
+ // 构建请求头
18
+ const requestHeaders = Object.assign({ 'lofter-micro-secret': getSecret() }, headers);
19
+ // 构建请求体
20
+ let data;
21
+ if (formData !== undefined) {
22
+ requestHeaders['Content-Type'] = 'application/x-www-form-urlencoded';
23
+ data = new URLSearchParams(Object.entries(formData).map(([k, v]) => [k, String(v)])).toString();
24
+ }
25
+ else if (json !== undefined) {
26
+ requestHeaders['Content-Type'] = 'application/json';
27
+ data = json;
28
+ }
29
+ else if (text !== undefined) {
30
+ data = text;
31
+ }
32
+ else if (buffer !== undefined) {
33
+ data = Buffer.from(buffer, 'base64');
34
+ }
35
+ // axios responseType 映射
36
+ const axiosResponseType = responseType === 'buffer' ? 'arraybuffer' : responseType;
37
+ const config = {
38
+ method: method.toUpperCase(),
39
+ url,
40
+ timeout,
41
+ params: query,
42
+ headers: requestHeaders,
43
+ data,
44
+ responseType: axiosResponseType,
45
+ };
46
+ const response = yield axios.request(config);
47
+ // 处理响应数据
48
+ let responseData;
49
+ if (responseType === 'buffer') {
50
+ // arraybuffer 转 Base64 字符串返回
51
+ responseData = Buffer.from(response.data).toString('base64');
52
+ }
53
+ else {
54
+ responseData = response.data;
55
+ }
56
+ return {
57
+ status: response.status,
58
+ headers: response.headers,
59
+ data: responseData,
60
+ };
61
+ });
54
62
  }
55
- export async function commonRequest(params) {
56
- return makeRequest(params);
63
+ export function commonRequest(params) {
64
+ return __awaiter(this, void 0, void 0, function* () {
65
+ return makeRequest(params);
66
+ });
57
67
  }
58
- //# sourceMappingURL=request.js.map
@@ -1,12 +1,23 @@
1
- import { httpGet } from '../http-client';
2
- export async function listMicroApps() {
3
- const resp = await httpGet('/micro/config', {
4
- withAuth: true,
5
- timeout: 10_000,
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ import { httpGet } from '../http-client.js';
11
+ export function listMicroApps() {
12
+ return __awaiter(this, void 0, void 0, function* () {
13
+ var _a;
14
+ const resp = yield httpGet('/micro/config', {
15
+ withAuth: true,
16
+ timeout: 10000,
17
+ });
18
+ if (resp.code !== 0) {
19
+ throw new Error(`接口返回错误: ${(_a = resp.message) !== null && _a !== void 0 ? _a : resp.code}`);
20
+ }
21
+ return resp.data;
6
22
  });
7
- if (resp.code !== 0) {
8
- throw new Error(`接口返回错误: ${resp.message ?? resp.code}`);
9
- }
10
- return resp.data;
11
23
  }
12
- //# sourceMappingURL=list-micro-apps.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lofter-admin/mcp-backend",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "LOFTER Admin MCP Server",
5
5
  "type": "module",
6
6
  "bin": {
@@ -11,12 +11,23 @@
11
11
  "README.md"
12
12
  ],
13
13
  "exports": {
14
- ".": "./dist/cli.js",
15
- "./server": "./dist/server.js"
14
+ ".": "./src/cli.js",
15
+ "./server": "./server.ts"
16
16
  },
17
17
  "publishConfig": {
18
18
  "access": "public",
19
- "registry": "https://registry.npmjs.org"
19
+ "registry": "https://registry.npmjs.org",
20
+ "exports": {
21
+ ".": "./dist/cli.js",
22
+ "./server": "./dist/server.js"
23
+ }
24
+ },
25
+ "scripts": {
26
+ "clean": "rimraf dist",
27
+ "dev": "tsc --watch",
28
+ "build": "npm run clean && tsc",
29
+ "prepublishOnly": "npm run build",
30
+ "start": "node dist/cli.js start"
20
31
  },
21
32
  "dependencies": {
22
33
  "@modelcontextprotocol/sdk": "^1.10.2",
@@ -31,11 +42,5 @@
31
42
  },
32
43
  "engines": {
33
44
  "node": ">=20"
34
- },
35
- "scripts": {
36
- "clean": "rimraf dist",
37
- "dev": "tsc --watch",
38
- "build": "npm run clean && tsc",
39
- "start": "node dist/cli.js start"
40
45
  }
41
- }
46
+ }
package/dist/cli.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,6BAA6B,EAAE,MAAM,oDAAoD,CAAC;AACnG,OAAO,EAAE,YAAY,EAA6C,MAAM,WAAW,CAAC;AACpF,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAC3C,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAE3C,MAAM,OAAO,GAAG,IAAI,OAAO,EAAE,CA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