MCP сервер для взаимодействия с Bitrix24 rest api на основе fast-bitrix24
Project description
MCP сервер для взаимодействия с Bitrix24 rest api на основе fast-bitrix24
Сервер находится в стадии разработки и тестирования. Рекомендуется использовать только в локальной частной сети.
На данный момент сервер поддерживает следsующие сущности:
- сделки
- пользовательские поля
поддержка человеческого названия полей даже для полей типа список например:
- какая сумма сделок где поле 'этаж доставки' равно 'в подвал'?
- какая сумма сделок которые нужно доставить в подвал
- как называется поле у сделки с id UF_CRM_1749724770090?
- сколько сделок с названием Обновленная тестовая сделка?
Установка и запуск сервера
установите переменные окружения из файла .env.example
cp .env.example .env
установите зависимости
uv sync
или установите пакет
uv add fast-bitrix24-mcp
создайте файл для запуска сервера
from fast_bitrix24_mcp.main import mcp
if __name__ == "__main__":
mcp.run(transport="sse", host="0.0.0.0", port=8000)
# mcp.run(transport="streamable-http", host="127.0.0.1", port=9000)
запустите сервер
uv run main.py
inspector
ui для тестирования сервера
npx @modelcontextprotocol/inspector
Пример использования в langchain
from langchain_mcp_adapters.client import MultiServerMCPClient
from langgraph.prebuilt import create_react_agent
from dotenv import load_dotenv
from pprint import pprint
load_dotenv()
client = MultiServerMCPClient(
{
"bitrix24-main": {
"url": "http://localhost:8000/sse",
"transport": "sse",
}
}
)
async def main():
tools = await client.get_tools()
promts = await client.get_prompt('bitrix24-main', 'main_prompt')
promts=promts[0].content
# agent = create_react_agent("openai:gpt-4.1-nano-2025-04-14", tools, prompt=promt)
agent = create_react_agent("openai:gpt-4.1-nano-2025-04-14", tools, prompt=promts, debug=True)
# math_response = await agent.ainvoke({"messages": "сколько сделок с названием Обновленная тестовая сделка ?"})
# math_response = await agent.ainvoke({"messages": "как называется поле у сделки с id UF_CRM_1749724770090?"})
# math_response = await agent.ainvoke({"messages": "какая сумма сделок где поле 'этаж доставки' равно 'в подвал'"})
# math_response = await agent.ainvoke({"messages": "какая сумма сделок у которых этаж доставки 'в подвал'?"})
math_response = await agent.ainvoke({"messages": "покажи статистику по сделкам за сегодня и позавчера"})
token=0
for message in math_response["messages"]:
print(message.content + "\n\n")
# pprint(math_response)
token=math_response["messages"][-1].usage_metadata['total_tokens']
print(f'token: {token}')
while True:
message = input("Введите сообщение: ")
math_response["messages"].append({"role": "user", "content": message})
math_response = await agent.ainvoke(math_response)
for message in math_response["messages"]:
print(message.content + "\n\n")
if __name__ == "__main__":
import asyncio
asyncio.run(main())
)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file fast_bitrix24_mcp-0.1.2.tar.gz.
File metadata
- Download URL: fast_bitrix24_mcp-0.1.2.tar.gz
- Upload date:
- Size: 14.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a046bc5e8339c1667f98d752831541d5581351013b799b30431880c1064bf070
|
|
| MD5 |
03f57c3feaa849fc55db79404a059a0e
|
|
| BLAKE2b-256 |
c9ed7be7e17f0bf16216fc35e4e4fe8918499dfe5e8497f51fe1b645c065de47
|
Provenance
The following attestation bundles were made for fast_bitrix24_mcp-0.1.2.tar.gz:
Publisher:
python-publish.yml on darkClaw921/fast-bitrix24-mcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
fast_bitrix24_mcp-0.1.2.tar.gz -
Subject digest:
a046bc5e8339c1667f98d752831541d5581351013b799b30431880c1064bf070 - Sigstore transparency entry: 417410977
- Sigstore integration time:
-
Permalink:
darkClaw921/fast-bitrix24-mcp@6c5672ff6c0d219f660234605885297e5c6e7f82 -
Branch / Tag:
refs/tags/v0.1.2.2 - Owner: https://github.com/darkClaw921
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@6c5672ff6c0d219f660234605885297e5c6e7f82 -
Trigger Event:
release
-
Statement type:
File details
Details for the file fast_bitrix24_mcp-0.1.2-py3-none-any.whl.
File metadata
- Download URL: fast_bitrix24_mcp-0.1.2-py3-none-any.whl
- Upload date:
- Size: 19.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c26c094285da55c65bdaf7a5c4159982a95e11d82843b506bdf23c823a892bbc
|
|
| MD5 |
e0e15bc20add406d04d28f6c3dd0cc79
|
|
| BLAKE2b-256 |
185888ef791f5b83412fee79a83e978e3ba2eff753697aa9939383cec15e6f9e
|
Provenance
The following attestation bundles were made for fast_bitrix24_mcp-0.1.2-py3-none-any.whl:
Publisher:
python-publish.yml on darkClaw921/fast-bitrix24-mcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
fast_bitrix24_mcp-0.1.2-py3-none-any.whl -
Subject digest:
c26c094285da55c65bdaf7a5c4159982a95e11d82843b506bdf23c823a892bbc - Sigstore transparency entry: 417410997
- Sigstore integration time:
-
Permalink:
darkClaw921/fast-bitrix24-mcp@6c5672ff6c0d219f660234605885297e5c6e7f82 -
Branch / Tag:
refs/tags/v0.1.2.2 - Owner: https://github.com/darkClaw921
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@6c5672ff6c0d219f660234605885297e5c6e7f82 -
Trigger Event:
release
-
Statement type: