llm_to_mcp_integration_engine
🔍 What is llm_to_mcp_integration_engine?
llm_to_mcp_integration_engine is a new idea for a communication layer between LLMs and MCP servers or functions.
It enhances the reliability of tool calling by ensuring tools are selected, validated, and executed correctly before triggering any external process.
It searches for tool selection indicators (SELECTED_TOOLS, SELECTED_TOOL, NO_TOOLS_SELECTED) in the LLM's response and validates them against a predefined tool list.
🚀 What is new about llm_to_mcp_integration_engine?
The llm_to_mcp_integration_engine distinguishes itself by effectively handling unstructured outputs and incorporating dynamic parsing and retry mechanisms(RETRY_PROMPT,CHANGE_LLM_IN_RETRY), offering a more flexible and resilient solution for LLM-tool integration.
❓ Why do we need llm_to_mcp_integration_engine?
- LLMs often misformat or misorder tool calls, leading to failures.
- Tool execution must be validated before triggering any MCP server or function.
- This protocol brings clarity, control, and reliability to LLM-tool integrations.
❌ Is there an existing communication layer?
No.
This is a novel invention. We introduced the LLM2MCP protocol, a first-of-its-kind communication framework that connects LLMs to MCP servers or functions in a structured, validated, and controllable way.
What makes it new:
- Dual Registration: Tools/functions are listed in both the LLM prompt and the engine, ensuring alignment and consistency.
- Non-JSON Tolerance: Even when the LLM response is not fully JSON, the engine can still extract valid tool selections using regex and logic-based checks.
- Retry Framework: If validation fails (missing tools, incorrect formats, etc.), the engine can retry with a new prompt or even switch to a different LLM.
- Fine-Grained Failure Detection: Developers can diagnose exactly where the LLM fails — whether in selecting the right tool, formatting parameters, or transitioning to tool execution.
- Execution Safety: The engine ensures no tool or MCP server is called unless the response is valid and verified.
This bundling of validation, fallbacks, control logic, and robustness into a single integration engine is what makes it a new invention.
⚙️ How to Use It
📦 Install via pip
pip install llm_to_mcp_integration_engine
✅ Default Usage
from llm_to_mcp_integration_engine import llm_to_mcp_integration_default
llm_to_mcp_integration_default(
tools_list=my_tools_list,
llm_respons=response_from_llm,
json_validation=True
)
🔧 Advanced Usage
from llm_to_mcp_integration_engine import llm_to_mcp_integration_advance
llm_to_mcp_integration_advance(
tools_list=my_tools_list,
llm_respons=response_from_llm,
json_validation=True,
no_tools_selected=True,
multi_stage_tools_select=True
)
🧠 Custom Usage (e.g., for agentic HTML/CSS tools)
from llm_to_mcp_integration_engine import llm_to_mcp_integration_custom
llm_to_mcp_integration_custom(
tools_list=my_tools_list,
llm_respons=response_from_llm,
json_validation=True
)
✅ Benefits of Using llm_to_mcp_integration_engine
- Flexible Response Handling
- Reliable Tool Execution
- Reliable Programmatic Validation
- Improved Tool Chaining
- Synergy with Reasoning Techniques (e.g., Chain-of-Thought)
- Handles "No Tools Needed" Scenarios
- Error Detection and Retry Mechanism
- Failure Diagnostics & Monitoring
- Cost Optimization via Tiered LLM Usage
- Standardization of LLM-to-Tool Interfaces
💡 Also includes dynamic LLM switching on failure for enhanced robustness and cost-efficiency.
📜 License
You are free to use this engine for personal and research purposes.
However, you are not allowed to modify or distribute it without explicit permission from the author.
Metadata
Release files for llm-to-mcp-integration-engine 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 | |
|---|---|---|---|---|
| llm_to_mcp_integration_engine-0.1.0.tar.gz | 20.5 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| llm_to_mcp_integration_engine-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 36.3 kB
Release files / llm_to_mcp_integration_engine-0.1.0.tar.gz
| Download URL | llm_to_mcp_integration_engine-0.1.0.tar.gz |
|---|---|
| Size | 20.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3d23e6cc60a49f0433292d8bb80537ddabff7a85b6e40daf13c1bc325621a148
|
|
BLAKE2b-256 checksum How to use checksums |
21dadc0be75a3f7e73b2af44f34e8f422f5c72442e791b54e9094fee58abb8f1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.9.13
|
Release files / llm_to_mcp_integration_engine-0.1.0-py3-none-any.whl
| Download URL | llm_to_mcp_integration_engine-0.1.0-py3-none-any.whl |
|---|---|
| Size | 15.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ff5017b623b98b44b28c22775df76aeb47028179529c76dd3ffc88e2c17c88dc
|
|
BLAKE2b-256 checksum How to use checksums |
e4200afbbce99717daeba79af055bbc62692f2af4dc5ace06590ac999c23a2f9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.9.13
|
Security for llm-to-mcp-integration-engine 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.