Skip to main content

Add your description here

Project description

MCP сервер для взаимодействия с Bitrix24 rest api на основе fast-bitrix24

На данный момент сервер поддерживает следующие сущности:

  • сделки
  • пользовательские поля поддержка человеческого названия полей даже для полей типа список например: какая сумма сделок где поле 'этаж доставки' равно 'в подвал'? какая сумма сделок которые нужно доставить в подвал как называется поле у сделки с id UF_CRM_1749724770090? сколько сделок с названием Обновленная тестовая сделка?

Установка и запуск сервера

uv sync
uv run main.py

inspector

для тестирования сервера

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("Enter your message: ")
        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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fast_bitrix24_mcp-0.1.0.tar.gz (9.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fast_bitrix24_mcp-0.1.0-py3-none-any.whl (11.3 kB view details)

Uploaded Python 3

File details

Details for the file fast_bitrix24_mcp-0.1.0.tar.gz.

File metadata

  • Download URL: fast_bitrix24_mcp-0.1.0.tar.gz
  • Upload date:
  • Size: 9.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for fast_bitrix24_mcp-0.1.0.tar.gz
Algorithm Hash digest
SHA256 a312ae562dbdc43a82e48d066cc0cbc2d3b9e5dca1703f8f1b81a799cab5b4be
MD5 0378116478dddc49233395b7ad8e8c03
BLAKE2b-256 7a51286f807cd43452630a048bd55e871bb2d1bddc9d81c02d8e651a47207996

See more details on using hashes here.

Provenance

The following attestation bundles were made for fast_bitrix24_mcp-0.1.0.tar.gz:

Publisher: python-publish.yml on darkClaw921/fast-bitrix24-mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file fast_bitrix24_mcp-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for fast_bitrix24_mcp-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7be747cf4cadd2b19b7263c3b9e3ae05f0e086121001a5ac5f722a117a644503
MD5 7ebb1353cf08a7013c1ef7ca1e5c1f5f
BLAKE2b-256 62b2968f6711f1edd3345ffaccb7ee8d5c6cd108a04d342e041d35adf33ab989

See more details on using hashes here.

Provenance

The following attestation bundles were made for fast_bitrix24_mcp-0.1.0-py3-none-any.whl:

Publisher: python-publish.yml on darkClaw921/fast-bitrix24-mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page