IP查询服务

一个基于LibreChat和Ollama的IP查询服务,提供本地和外部IP地址查询功能。

  • by dev-johnny-gh
  • TypeScript
  • 本地部署
  • 更新于
在 GitHub 查看 dev-johnny-gh/mcp-server-demo

使用说明

安装

  1. cd IpServer&npm安装&npm运行构建&npm运行启动

  2. 安装本地mongodb服务器并在其上提供服务mongodb://127.0.0.1:27017

  3. cd LibreChat&git克隆git@github.com:danny avila/LibreChat.git&mv.env.example.env&npm安装&npm运行前端&npm运行后端

  4. 将以下配置添加到librechat.yaml文件中:

mcpServers:
  ipServer:
    # type: sse # type can optionally be omitted
    url: http://localhost:3000/sse
    timeout: 60000 # 1 minute timeout for this server, this is the default timeout for MCP servers.

endpoints:
  custom:
    - name: "Ollama"
      apiKey: "ollama"
      # use 'host.docker.internal' instead of localhost if running LibreChat in a docker container
      baseURL: "http://localhost:11434/v1/chat/completions"
      models:
        default:
          [
            "qwen2.5:3b-instruct-q4_K_M",
            "mistral:7b-instruct-q4_K_M",
            "gemma:7b-instruct-q4_K_M",
          ]
        # fetching list of models is supported but the `name` field must start
        # with `ollama` (case-insensitive), as it does in this example.
        fetch: true
      titleConvo: true
      titleModel: "current_model"
      summarize: false
      summaryModel: "current_model"
      forcePrompt: false
      modelDisplayLabel: "Ollama"
  1. 下载并运行ollama,从下载模型https://ollama.ai/models/为奥拉玛服务http://localhost:11434/

用法

  1. 访问http://localhost:3080/查看LibreChat用户界面。

  2. 创建一个名为“Ollama”的新代理,选择Ollama作为模型提供者,然后选择一个模型

  3. 点击下面的添加工具按钮,添加获取外部ip、get-local-ip-v6、get-eternal-ip-v6、获取本地ip工具

  4. 请问代理我的本地ip地址是什么?/我的外部ip地址是什么?/我的外部ipv6地址是什么?/我的内部ipv6地址是什么?

  5. 代理应调用您的工具并返回结果。