Skip to main content
Glama

MCP Server Example

MCP 服务器示例

该项目是一个非常基本的 MCP 服务器,可供 Cursor 或其他工具使用。

修改 index.ts 并添加您想要的任何工具,或保留默认工具。

然后构建项目:

pnpm run build

并运行它:

pnpm run start

现在在您的项目中添加一个 .cursor/mcp.json 文件,并粘贴以下内容;

{ "mcpServers":{ "weather":{ "command": "node", "args": ["[path]/build/index.js"] } } }

[path] 替换为此项目的绝对路径。在项目文件夹中运行 pwd 即可。例如,在我的情况下,它是:

{ "mcpServers":{ "weather":{ "command": "node", "args": ["/Users/ivanbtrujillo/Development/mcp-server-spike/build/index.js"] } } }

现在前往光标处的“设置”。您应该能够在那里看到 MCP 服务器。启用它(点击右上角)MCP 服务器光标

现在进入聊天,切换到代理模式并选择 claude-3.7-sonnet 作为您的模型。

输入以下内容:

What is the weather in Texas?

它将使用 MCP 首先获取天气警报,然后获取天气预报。以下是查询德克萨斯州天气时聊天界面的示例:

聊天界面

Install Server
A
security – no known vulnerabilities
F
license - not found
A
quality - confirmed to work

一个基本的 MCP 服务器模板,可以与 Cursor 集成,以使用 Claude-3.7-sonnet 模型实现天气信息检索等 AI 工具。

Related MCP Servers

  • -
    security
    F
    license
    -
    quality
    A simple MCP service that allows users to query weather conditions for cities worldwide through the Cursor AI assistant.
    Last updated -
    JavaScript
  • -
    security
    F
    license
    -
    quality
    An MCP server implementation that allows users to fetch and display weather information for specified cities, including temperature, humidity, wind speed, and weather descriptions.
    Last updated -
    Python
    • Linux
    • Apple
  • -
    security
    F
    license
    -
    quality
    An MCP-based project that integrates Zhipu AI and Tencent Map APIs to provide weather queries, geocoding, and web search functionality through both command-line and web interfaces.
    Last updated -
    2
    Python
  • A
    security
    A
    license
    A
    quality
    An MCP server that allows retrieving meteorological and climate data from Spain's State Meteorological Agency (AEMET) API directly from Claude AI and other MCP-compatible clients.
    Last updated -
    7
    2
    Python
    MIT License
    • Apple
    • Linux

View all related MCP servers

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/ivanbtrujillo/mcp-server-spike'

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