Back to MCP directory
publicPublicdnsLocal runtime

mcp-app

MCP应用是一个结合RAG和网络搜索工具的服务,使用OpenAI嵌入向量存储,PostgreSQL作为数据库,PGVector作为向量存储,支持知识检索和文档添加功能。

article

README

🚀 MCP 应用程序

MCP 应用程序结合了 RAG 和网络搜索工具。借助 RAG 工具,LLM 不仅能从向量存储中检索知识,还可添加文档,有效增加其使用的知识量。

🚀 快速开始

uv sync
source .venv/bin/activate
mcp dev run

✨ 主要特性

  • ⚙️ MCP 服务器应用用于实现 MCP 服务器。
  • 🧰 SQLAlchemy 用于与 SQL 数据库的交互(ORM)。
  • 🤖 OpenAI 用于向量存储的嵌入。
  • 💾 PostgreSQL 作为 SQL 数据库。
  • 🦜 PGVector 作为向量存储。

📦 安装指南

# 必须安装 pyproject.toml 中列出的所有依赖项
mcp install server.py --env-file .env --with sqlalchemy --with pgvector --with openai --with "psycopg[binary]" --with pydantic --with python-dotenv --with tavily-python

💻 使用示例

基础用法

将 Claude Desktop 与 MCP APP 结合使用,可运行以下命令:

# 必须安装 pyproject.toml 中列出的所有依赖项
mcp install server.py --env-file .env --with sqlalchemy --with pgvector --with openai --with "psycopg[binary]" --with pydantic --with python-dotenv --with tavily-python

效果预览

Claude Desktop 的使用效果如下: 第一个查询 第二个查询 执行添加文档到数据库的结果

🔧 技术细节

本项目使用了以下技术栈: | 属性 | 详情 | |------|------| | 服务器应用 | MCP 服务器应用用于实现 MCP 服务器 | | 数据库交互 | SQLAlchemy 用于与 SQL 数据库的交互(ORM) | | 向量嵌入 | OpenAI 用于向量存储的嵌入 | | 数据库 | PostgreSQL 作为 SQL 数据库 | | 向量存储 | PGVector 作为向量存储 |

📄 待办事项

  • 实现异步版本。
help

Runtime guide

cloud

Hosted runtime

Hosted servers run from a provider-managed environment. You usually connect the MCP client to the hosted endpoint or follow the provider's authorization flow, without keeping a local process alive

  1. Open provider connection page
  2. Authorize or copy endpoint
  3. Connect from your MCP client
terminal

Local runtime / other methods

Local servers run on your own machine or infrastructure. You normally copy the server_config into your MCP client, install the required package, and provide env variables from env_schema when needed

  1. Copy server_config
  2. Install required package
  3. Fill env variables and restart client