项目说明
财蕴天下服务端项目目录
创建项目
# 项目初始化 [默认当前文件夹]
uv init [project_name]
# 创建虚拟环境
uv venv
# 添加依赖(会更新 pyproject.toml)
uv add "mcp[cli]"
uv add dotenv
uv add flask
uv add gunicorn
uv add websockets
uv add dashscope
uv add requests
uv add deepmerge
uv add alibabacloud-bailian20231229
uv add fastapi
# 同步项目依赖
uv sync
# 把依赖关系写入文件
uv pip freeze > requirements.txt
# 安装依赖
uv pip install -r requirements.txt
Debug run 本地mcp测试验证
# 先启动mcp sse服务
uv run cytx_mcp_server.py
# 再启动调试工具
uv run mcp dev cytx_mcp_server.py
# fastapi启动
uvicorn main:app --host 0.0.0.0 --port 8001 --reload --debug --log-level debug
# 新的mcp server 启动 -- 报告解读
uv run cytx_report_mcp_server.py
生产 run
# 生产安装python
CPPFLAGS="$(pkg-config --cflags openssl11)" \
LDFLAGS="$(pkg-config --libs openssl11)" \
pyenv install -v 3.12.0
#生产启动mcp server
nohup uv run cytx_mcp_server.py --host 0.0.0.0 --port=8000 > mcp.log 2>&1 &
# 生成启动 报告mcp server
nohup uv run cytx_report_mcp_server.py --host 0.0.0.0 --port=8002 > report.log 2>&1 &
# fastapi启动
uvicorn main:app --host 0.0.0.0 --port 8001 --reload
# fastapi 生产启动
uvicorn -D main:app --host 0.0.0.0 --port 8001 --workers 4
## fastapi 日志输出到文件
nohup uv run uvicorn main:app --host 0.0.0.0 --port 8001 --workers 4 > api.log 2>&1 &
### 生成 stop
~~~ shell
# 查看进程
ps -ef | grep cytx_mcp_server.py
# 停止mcp server
pkill -f cytx_mcp_server.py
#停止gunicorn
pkill -f gunicorn
生产配合nginx使用
location /cytxapi/ {
proxy_pass http://127.0.0.1:8001/cytxapi/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
#proxy_set_header X-Forwarded-For $proxy_add_xforwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_connect_timeout 60s;
proxy_read_timeout 120s;
}
location /chatws {
proxy_pass http://127.0.0.1:8001/chatws;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_read_timeout 86400s;
#proxy_write_timeout 86400s;
}
location /fileUploads/ {
alias /opt/server/ai-cytx-fastapi/uploads/;
}
百炼平台mcp server配置
开发环境:
{
"mcpServers":{
"CytxApp":{
"url":"http://123.56.40.34:8000/sse"
}
}
}
{
"mcpServers":{
"CytxApp":{
"url":"http://123.56.40.34:8002/sse"
}
}
}
测试环境:
{
"mcpServers":{
"CytxApp":{
"url":"http://101.201.61.165:8000/sse"
}
}
}
大模型文档说明
提示词说明文档
doc/project/cytx/prompt/prompt-omini.md
doc/project/cytx/prompt/prompt-core.md
知识库相关文档
doc/project/cytx/kb/
接口相关文档
doc/project/cytx/api/
Metadata
Release files for ai-cytx 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| ai_cytx-0.1.0.tar.gz | 34.2 kB | Without provenance | Details for ai_cytx-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| ai_cytx-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for ai_cytx-0.1.0-py3-none-any.whl |
Total release size: 75.6 kB
Release files / ai_cytx-0.1.0.tar.gz
| Download URL | ai_cytx-0.1.0.tar.gz |
|---|---|
| Size | 34.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
50245d3512e4f2f924489f53f2d9f8bab804cd76f4714f8b1086b1919cc00030
|
|
BLAKE2b-256 checksum How to use checksums |
a8cd67b826a88ff2a90c6627ad91b4f4f3a6062a64d38d5337ce67256152838a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.6.16
|
Release files / ai_cytx-0.1.0-py3-none-any.whl
| Download URL | ai_cytx-0.1.0-py3-none-any.whl |
|---|---|
| Size | 41.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7836beb2a6aa68ff616d8c4b31bce728ea182c40124ceccb1489a2d46d6e0771
|
|
BLAKE2b-256 checksum How to use checksums |
32547d053ecb578a4bad4b5ba195607a3a0c4377937a906c893e86d105f6b92f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.6.16
|
Security for ai-cytx 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.