Token导航 LogoToken导航TokenDH.com
Requirements Advisor Client logo
AI代理stdio官方级别未说明来源级核验

Requirements Advisor Client

MCP Server

一个连接远程MCP服务器的需求管理指导工具,提供多LLM支持的聊天界面。

工具数

0

提示词数

0

GitHub Stars

0

资源数

0
Python聊天界面AI代理

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

arthurfantaci

提供方

arthurfantaci

最后核验

2026/5/17 20:21

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

命令预览

pip install -e ".[dev]"

详细介绍

需求顾问客户端

![Python 3.11+](https://www.python.org/downloads/) ![License: MIT](https://opensource.org/licenses/MIT) ![Code style: ruff](https://github.com/astral-sh/ruff)

MCP客户端web应用程序,用于需求管理指导。连接到远程MCP服务器,并提供具有多LLM支持的聊天界面。

特性

  • 多LLM支持:克劳德、GPT-4o和双子座通过LiteLLM
  • MCP集成:使用流式HTTP传输连接到远程MCP服务器
  • 主题聚焦:严格的系统提示确保响应保持在需求管理主题上
  • 聊天界面:基于流媒体的用户界面,带有对话历史记录
  • 会话保持:PostgreSQL/SQLite存储聊天记录
  • Docker支持:开发和生产的多阶段构建
  • 综合测试:具有异步支持和覆盖率的pytest

建筑

┌─────────────────────┐     REST API      ┌─────────────────────┐
│  Streamlit Frontend │ ←───────────────→ │   FastAPI Backend   │
│  (port 8501)        │                   │   (port 8000)       │
│  - Chat UI          │                   │   - MCP Client      │
│  - Session state    │                   │   - LLM Integration │
│  - Custom styling   │                   │   - Session storage │
└─────────────────────┘                   └─────────────────────┘
                                                   │
                                                   ▼
                                         ┌─────────────────────┐
                                         │   MCP Server        │
                                         │   (Railway)         │
                                         │   /mcp endpoint     │
                                         └─────────────────────┘

项目结构

requirements-advisor-client/
├── src/requirements_advisor_client/
│   ├── backend/              # FastAPI application
│   │   ├── main.py           # API endpoints
│   │   ├── config.py         # Pydantic settings
│   │   ├── logging.py        # Loguru setup
│   │   ├── mcp_client.py     # MCP client class
│   │   ├── llm.py            # LiteLLM integration
│   │   ├── models.py         # Pydantic models
│   │   └── database.py       # SQLAlchemy setup
│   └── frontend/             # Streamlit application
│       ├── app.py            # Chat UI
│       ├── config.py         # Frontend settings
│       ├── styles.py         # CSS/branding
│       └── .streamlit/
│           └── config.toml   # Theme configuration
├── tests/                    # pytest test suite
├── Dockerfile                # Multi-stage Docker build
├── docker-compose.yml        # Development setup
├── railway.toml              # Railway deployment config
└── pyproject.toml            # Project configuration

快速开始

先决条件

  • Python 3.11+
  • 紫外线 (推荐)或pip
  • 至少一个LLM提供程序的API密钥

紫外线安装(推荐)

# Clone the repository
git clone https://github.com/arthurfantaci/requirements-advisor-client.git
cd requirements-advisor-client

# Install dependencies
uv sync

# Install dev dependencies
uv sync --all-extras

管道安装

pip install -e ".[dev]"

配置

复制示例环境文件并配置API密钥:

cp .env.example .env

编辑 .env 根据您的配置:

# Required: At least one LLM API key
ANTHROPIC_API_KEY=sk-ant-...
OPENAI_API_KEY=sk-...        # Optional
GOOGLE_API_KEY=...           # Optional

# Optional: Override defaults
MCP_SERVER_URL=https://requirements-advisor-production.up.railway.app/mcp
DATABASE_URL=sqlite+aiosqlite:///./data/sessions.db
LOG_LEVEL=INFO

本地运行

选项1:使用紫外线

# Terminal 1: Start backend
uv run uvicorn requirements_advisor_client.backend.main:app --reload --port 8000

# Terminal 2: Start frontend
uv run streamlit run src/requirements_advisor_client/frontend/app.py --server.port 8501

选项2:使用Docker Compose

# Start both services
docker compose up --build

# Or run in detached mode
docker compose up -d --build

打开http://localhost:8501在您的浏览器中。

发展

运行测试

# Run all tests
uv run pytest

# Run with coverage report
uv run pytest --cov

# Run specific test file
uv run pytest tests/backend/test_mcp_client.py

代码质量

# Run linter
uv run ruff check .

# Run formatter
uv run ruff format .

# Install pre-commit hooks
uv run pre-commit install

类型检查

代码库始终使用类型提示。使用IDE的类型检查器或运行:

uv run pyright src/

码头工人

构建图像

# Build backend
docker build --target backend -t advisor-backend .

# Build frontend
docker build --target frontend -t advisor-frontend .

Docker编写服务

# Start all services
docker compose up

# Start with PostgreSQL (optional)
docker compose --profile postgres up

# Stop services
docker compose down

环境变量

后端

变量描述默认值
MCP_SERVER_URL远程MCP服务器URLhttps://requirements-advisor-production.up.railway.app/mcp
DATABASE_URL数据库连接字符串sqlite+aiosqlite:///./data/sessions.db
BACKEND_HOST服务器绑定地址0.0.0.0
BACKEND_PORT服务器端口8000
LOG_LEVEL日志记录级别INFO
LOG_JSON以JSON格式输出日志false
LLM_MAX_ITERATIONS每个请求的最大工具调用迭代次数10
ANTHROPIC_API_KEY无烟煤API密钥-
OPENAI_API_KEYOpenAI API密钥-
GOOGLE_API_KEY谷歌人工智能API密钥-

前端

变量描述默认值
API_URL后端API URLhttp://localhost:8000

部署

铁路

这两个服务都配置为使用Dockerfile进行Railway部署。

  1. 创建新的铁路项目
  2. 从存储库根添加后端服务(目标: backend)
  3. 从存储库根添加前端服务(目标: frontend)
  4. 添加PostgreSQL数据库
  5. 配置环境变量:

- 后端:API密钥+ DATABASE_URL=${{Postgres.DATABASE_URL}} - 前端: API_URL=http://${{backend.RAILWAY_PRIVATE_DOMAIN}}:${{backend.PORT}}

API终点

GET /health

健康检查端点。

{
  "status": "healthy",
  "mcp_connected": true,
  "version": "0.1.0"
}

GET /tools

列出可用的MCP工具。

POST /chat

发送聊天消息。

{
  "message": "How do I write good requirements?",
  "provider": "gemini",
  "session_id": null,
  "history": []
}

答复:

{
  "response": "Here are some best practices...",
  "session_id": "abc123",
  "tools_used": []
}

### `GET /history/{session_id}`

Get chat history for a session.

## Contributing

1. Fork the repository
2. Create a feature branch (`git checkout -b feature/amazing-feature`)
3. Install pre-commit hooks (`pre-commit install`)
4. Make your changes
5. Run tests (`pytest`)
6. Commit your changes (`git commit -m 'Add amazing feature'`)
7. Push to the branch (`git push origin feature/amazing-feature`)
8. Open a Pull Request

## License

MIT

目录标签

目录标签

Python聊天界面AI代理需求管理本地部署多LLM支持MCP集成会话持久化

接入字段

传输方式(transport,传输协议)

stdio

鉴权方式(authType,认证方式)

api-key

工具数量(toolCount,工具数)

0

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

stdioapi-key部署方式未说明

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

来源信息

继续浏览同类 MCP