Skip to main content

Bridgic MCP Integration

This package provides Model Context Protocol (MCP) integration for the Bridgic framework.

Overview

The bridgic-protocols-mcp package enables Bridgic to connect to and interact with MCP servers, allowing you to:

  • Connect to MCP Servers: Establish connections via different transports and connections with lifecycle management
  • Use MCP Tools: Integrate MCP tools seamlessly into Bridgic agentic workflows
  • Access MCP Prompts: Retrieve and use prompts from MCP servers

Installation

pip install bridgic-protocols-mcp

Quick Start

Connecting to an MCP Server

from bridgic.protocols.mcp import McpServerConnectionStdio

# Create a connection to a filesystem MCP server
connection = McpServerConnectionStdio(
    name="filesystem-server",
    command="npx",
    args=["-y", "@modelcontextprotocol/server-filesystem", "/path/to/directory"],
)

# Establish the connection
connection.connect()

# List available tools
tools = connection.list_tools()
for tool in tools:
    print(f"Tool: {tool.tool_name} - {tool.tool_description}")

Using MCP Tools in an Automa

MCP tools can be integrated into Bridgic automas as workers in GraphAutoma. Furthermore, in ReCentAutoma, these tools can be used in a more advanced LLM-driven agents to select and invoke them dynamically.

Using MCP Tools as Workers in GraphAutoma

MCP tools can be converted to workers and added to a GraphAutoma, giving them the same execution status as regular scheduling units. This allows you to orchestrate MCP tool calls alongside other workers in your workflow.

from bridgic.core.automa import GraphAutoma
from bridgic.protocols.mcp import McpServerConnectionStdio

# Setup connection
connection = ...
connection.connect()

# Create automa and add MCP tools as workers. Then they can be orchestrated with other workers, 
# participate in dependency graphs, and be scheduled just like any other worker in the system.
automa = GraphAutoma()
for tool_spec in connection.list_tools():
    # Convert each MCP tool to a worker and add it to the automa
    worker = tool_spec.create_worker()
    automa.add_worker(worker)

Using MCP Tools with ReCentAutoma

MCP tools can also be used directly with ReCentAutoma, where the LLM can autonomously select and call tools based on the user's request. This enables building intelligent agents that can interact with MCP servers through natural language.

from bridgic.core.agentic.recent import ReCentAutoma
from bridgic.protocols.mcp import McpServerConnectionStreamableHttp
from bridgic.llms.openai import OpenAILlm, OpenAIConfiguration
import os

# Setup MCP connection
connection = ...
connection.connect()

# Create ReCentAutoma with MCP tools
react_automa = ReCentAutoma(
    llm=llm,
    tools=connection.list_tools(),
)

Features

Connection Management

The package provides two connection implementations:

  • McpServerConnectionStdio: For stdio-based MCP servers
  • McpServerConnectionStreamableHttp: For HTTP-based MCP servers

Both support:

  • Automatic lifecycle management
  • Thread-safe operations
  • Timeout configuration

Tool Integration

MCP tools are automatically wrapped in Bridgic's tool system:

  • McpToolSpec: Represents an MCP tool as a Bridgic tool specification
  • McpToolWorker: Executes MCP tool calls

Prompt Integration

Access prompts from MCP servers:

# List available prompts
prompts = connection.list_prompts()

# Get a specific prompt
prompt_template = prompts[0]
messages = prompt_template.format_messages(arg1="value1", arg2="value2")

Release files for bridgic-protocols-mcp 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for bridgic-protocols-mcp 0.1.1
File Size Uploaded
bridgic_protocols_mcp-0.1.1.tar.gz 14.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for bridgic-protocols-mcp 0.1.1
File Interpreter ABI Platform
bridgic_protocols_mcp-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 34.4 kB

Release files / bridgic_protocols_mcp-0.1.1.tar.gz

Download URL bridgic_protocols_mcp-0.1.1.tar.gz
Size 14.6 kB
Tags Source
SHA-256 checksum
How to use checksums
265e6bf7f201366f75d20e94ecf705268252e026e9b526bdb411ffc8f7bdccda
BLAKE2b-256 checksum
How to use checksums
8e462e85a5d71682fb78460df462ca13048909a5535874b5a0439e1d8a2a586a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.17 {"installer":{"name":"uv","version":"0.9.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / bridgic_protocols_mcp-0.1.1-py3-none-any.whl

Download URL bridgic_protocols_mcp-0.1.1-py3-none-any.whl
Size 19.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
de8ec83a23ab793cdab477fe90e853240f0417001668660027458927cdb5c12b
BLAKE2b-256 checksum
How to use checksums
2ef4f41f37eefea52a45c91efcc41cd3d3ca51d3860043b6c809665deb5837e9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.17 {"installer":{"name":"uv","version":"0.9.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page