使用说明
自述文件
终端用户使用情况(书呆子级别)
如果你只想在你选择的MCP就绪AI应用程序中使用它,请按照以下步骤操作:
-
获取您的个人openweathermap.org API密钥:
- 创建一个 账户
- 创建API-key 这里
- 打开AI应用程序的配置文件。根据您的应用程序,这可能会有所不同。你需要
增加
将此数据添加到您的配置中(例如,从
librechat.yaml):mcpServers: openweather-mcp-server: type: stdio command: java args: - -jar - /app/my-mcp-servers/openweather-mcp-server-0.1.2.jar - --spring.config.additional-location=file:/app/my-mcp-servers/application-prod.yml
- 打开AI应用程序的配置文件。根据您的应用程序,这可能会有所不同。你需要
增加
将此数据添加到您的配置中(例如,从
-
下载openweather mcp服务器的*.jar文件
-
将其复制到可访问的位置
- Docker中的LibreChat:创建文件夹
/LIBRECHAT/my-mcp-servers/
- Docker中的LibreChat:创建文件夹
-
确保,
java安装在该位置-
Docker中的LibreChat:in
/LIBRECHAT/Dockerfile更改此行:# original RUN apk add --no-cache python3 py3-pip uv # change into this RUN apk add --no-cache python3 py3-pip uv openjdk21-jre
-
-
确保一切都可以到达并打包在一起:
- Docker中的LibreChat:
-
在文件中
/LIBRECHAT/docker-compose.yml:# original image: ghcr.io/danny-avila/librechat-dev:latest # change into this # image: ghcr.io/danny-avila/librechat-dev:latest build: . -
现在你可以重建了
-
- Docker中的LibreChat:
-
现在您可以重建,重新启动。在当前版本中,执行就足够了
docker compose build --no-cache && docker compose up -d如有任何问题,请坚持 到 更新指南. -
在您的AI应用程序中,您现在应该能够激活“openweather mcp服务器”并请求当前 天气 任何城市:)
开发:环境变量
要执行对openweathermap.org的远程调用,您需要一个个人API密钥(见上文),并在应用程序中设置它
个人资料(application-dev.yml)或环境变量。
设置此环境变量(例如在测试启动器中):
secret.openweathermap.apikey=YOUR-OPENWEATHERMAP-API-KEY