Skip to main content
Glama
cromwellian

Hippycampus MCP Server

by cromwellian

嬉皮校园

基于 LangChain 的 CLI 和 MCP 服务器,支持动态加载 OpenAPI 规范并与 Langflow 集成。

先决条件

  • Python 3.12.9

  • UV包管理器

  • Google AI Studio API 密钥

  • Langflow(用于可视化工作流程创建)

Related MCP server: OpenAPI MCP Server

安装

# Install UV if you haven't already
curl -LsSf https://astral.sh/uv/install.sh | sh

# Create and activate virtual environment
uv venv
source .venv/bin/activate  # On Windows use: .venv\Scripts\activate

# Install hippycampus and its dependencies
uv pip install -e .

# Install langflow
uv pip install langflow

配置

Google AI Studio API 密钥

  1. 访问Google AI Studio

  2. 点击右上角的“创建 API 密钥”

  3. 复制生成的密钥并将其设置为环境变量:

export GOOGLE_API_KEY='your-api-key-here'

运行应用程序

CLI 模式(无 MCP 服务器)

uv run hippycampus-cli

MCP 服务器模式 (SSE)

uv run hippycampus-server --transport sse --port 8000

Langflow 服务器

在启动 Langflow 之前,请确保 MCP 服务器正在运行。

  1. 设置组件路径环境变量:

# Get your current working directory
pwd
# Use the output to set the components path
export LANGFLOW_COMPONENTS_PATH="/output/from/pwd/langflow/components"
  1. 启动 Langflow 服务器(添加 --dev 以进入开发模式):

uv run langflow run
  1. 打开浏览器并导航至http://localhost:7860

在 Langflow 中使用自定义组件

  1. 在 Langflow UI 中,找到自定义组件:

    • OpenApi服务:用于加载OpenAPI规范

    • Hippycampus MCP 服务器:用于通过 SSE 连接到 MCP 服务器

  2. 配置组件:

    • OpenApi 服务:使用https://raw.githubusercontent.com/APIs-guru/unofficial_openapi_specs/master/xkcd.com/1.0.0/openapi.yaml进行测试

    • MCP 服务器:使用http://localhost:8000/sse

请参阅 Screencast 演示以获得视觉指南。Screencast演示

请注意,官方 XKCD swagger 文件包含一个错误,并将 comic_id 字段指定为数字而不是整数,测试文件夹中有一个修复版本。

故障排除

  • 身份验证错误:检查GOOGLE_API_KEY是否设置正确

  • Langflow 中缺少组件:验证LANGFLOW_COMPONENTS_PATH是否指向正确的目录

  • 连接问题:通过 Langflow 连接之前,请确保 MCP 服务器正在运行

  • 如果组件未出现在 Langflow 中,请尝试重新启动 Langflow 服务器

  • 在 MCP/Langflow 中运行之前,使用 cli 调试 openapi_builder/spec_parser 和代理交互问题。

执照

MIT 许可证

版权所有 (c) 2024 Ray Cromwell

特此授予获得此软件和相关文档文件(“软件”)副本的任何人免费许可,以无限制方式处理软件,包括但不限于使用、复制、修改、合并、发布、分发、再授权和/或销售软件副本的权利,并允许向其提供软件的人员这样做,但须遵守以下条件:

上述版权声明和本许可声明均应包含在软件的所有副本或实质性部分中。

本软件按“原样”提供,不附带任何形式的明示或暗示保证,包括但不限于适销性、适用于特定用途和非侵权性的保证。在任何情况下,作者或版权所有者均不对因本软件或使用或以其他方式处理本软件而引起的或与之相关的任何索赔、损害或其他责任承担责任,无论是合同、侵权或其他诉讼。

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    B
    maintenance
    A server that enables Large Language Models to discover and interact with REST APIs defined by OpenAPI specifications through the Model Context Protocol.
    9,156 npm
    298
    MIT
  • F
    license
    Not graded
    quality
    D
    maintenance
    Server that ingests Swagger/OpenAPI specifications and Postman collections, providing just 4 strategic tools that allow AI agents to dynamically discover and interact with APIs instead of generating hundreds of individual tools.
    3
    -
  • A
    license
    A
    quality
    D
    maintenance
    A generic MCP server that dynamically exposes any OpenAPI-documented REST API to LLMs by auto-discovering endpoints. It provides tools for exploring API capabilities and making authenticated requests directly through natural language interfaces.
    2
    8 npm
    MIT