实骨 shigu
  • Joined on 2026-08-12

@tmxk/mcp-server (0.2.5)

Published 2026-08-12 11:39:27 +00:00 by shigu

Installation

@tmxk:registry=https://gitea.cspy.site/api/packages/shigu/npm/
npm install @tmxk/mcp-server@0.2.5
"@tmxk/mcp-server": "0.2.5"

About this package

标准 MCP Server 的企业接入层。

@tmxk/mcp-server

标准 MCP Server 的企业接入层。

能力调用

生产模式下,MCP Server 每次 HTTP MCP 请求向 Enterprise Base Introspection,验证 issuer、Resource aud、scope、tenant、subject 和撤销状态。Base 不代理业务 payload;MCP Server 是实际 Resource Server。

const resourceServer = createResourceServer({
  issuer: process.env.TMXK_OAUTH_ISSUER,
  resource: process.env.TMXK_MCP_RESOURCE,
  introspection: {
    endpoint: process.env.TMXK_OAUTH_INTROSPECTION_URL,
    clientId: process.env.TMXK_OAUTH_INTROSPECTION_CLIENT_ID,
    clientSecret: process.env.TMXK_OAUTH_INTROSPECTION_CLIENT_SECRET
  }
});

两类 UI

examples 是服务自测和开发演示的 HTTP 页面,默认只允许 development mode;生产必须显式设置 exposeExamples: true。

apps 是 MCP Apps Resource,使用 ui:// URI,供支持 MCP Apps 的宿主嵌入。App 可以展示 Tool 输入、进度和结果,但不产生 OAuth grant;宿主触发 Tool 时仍由 MCP Server 验证 Base Token。

createMcpCapabilityServer({
  mode: 'development',
  resourceServer,
  serverInfo: { name: 'example', version: '1.0.0' },
  examples: [{ name: 'health', contentType: 'text/html', body: '<h1>ok</h1>' }],
  apps: [{ uri: 'ui://example/main.html', name: 'main', text: '<html>...</html>' }],
  tools: []
});

没有 Base 配置时必须显式使用 development mode;此时上下文固定为 development,不能用于生产部署。

Dependencies

Dependencies

ID Version
@modelcontextprotocol/sdk 1.30.0
@tmxk/lite-base ^0.4.0
Details
npm
2026-08-12 11:39:27 +00:00
62
10 KiB
Assets (1)
Versions (2) View all
0.2.6 2026-08-14
0.2.5 2026-08-12