Skip to main content
Glama
vmridul

my-server

by vmridul

my-server

一个带有 weather widget 的 MCP 服务器。server.tool({ widget: { dir: "weather" } }) 指向 src/widgets/weather/(React)。mcpfy-sdk 会把它打包好 — 不需要 server.widget(),不需要 HTML 文件, 也不要求 prompt/resource。

weather 工具在服务端从 Open-Meteo 获取温度。 widget 中的查询通过宿主调用该工具(callTool),iframe 不会直接 fetch 这个 API。

如果后续 main.tsxfetch 另一个源,请取消注释 src/server.ts 中的 widget.csp.connectDomains。ChatGPT 和 Claude Desktop 会应用该配置;Inspector 通常不会。

运行

本地(启动 MCP 服务器;widgets 在监听时打包 — 无需先单独构建):

npm run dev          # default transport: http
npm run dev:stdio
npm run dev:http     # HTTP on port 4000

生产环境 / ChatGPT(iframe 不能同样使用一次性的 dev 打包):

npm run build        # mcpfy build && tsc
npm start

Related MCP server: EightyAndSunny

在 MCP host 中使用

{
  "mcpServers": {
    "my-server": {
      "command": "npx",
      "args": ["mcpfy", "dev", "--", "--stdio"],
      "cwd": "/absolute/path/to/this-project"
    }
  }
}

接下来

  • UI:src/widgets/weather/main.tsxmcpfy-sdk/widget hooks)

  • 无 UI 的工具:在 server.tool() 上省略 widget

  • mcpfy docs

A
license - permissive license
Not graded
quality - not tested
C
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

View all related MCP servers

Related MCP Connectors

  • Open-Meteo MCP — weather forecast + historical reanalysis + sister APIs

  • MCP server exposing the Backtest360 engine API as tools for AI agents.

  • MCP server for AI dialogue using various LLM models via AceDataCloud

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/vmridul/sample-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server