Skip to main content

MCI Python Adapter - Quickstart Guide

Welcome to the MCI Python Adapter! This guide will help you get started quickly with installing, configuring, and using the MCI (Model Context Interface) adapter to define and execute tools in your Python applications.

Installation

Prerequisites

  • Python 3.11 or higher
  • uv package manager (recommended) or pip
First, install uv if you haven’t already:
Then install the MCI Python adapter:

Option 2: Using pip

Verify Installation

Quick Example

Here’s a complete example to get you started in under 5 minutes:

1. Create a Tool Schema File

Create a file named my-tools.mci.json:

2. Write Python Code

Create a file named example.py:

3. Run Your Code

Output:

What’s Next?

Now that you’ve seen the basics, explore these resources to learn more:

Key Concepts at a Glance

Execution Types

MCI supports four execution types:
  • Text: Return templated text directly
  • File: Read file contents with template substitution
  • CLI: Execute command-line tools
  • HTTP: Make HTTP API requests

Template Placeholders

Use placeholders in your configurations:
  • {{props.fieldName}} - Access input properties
  • {{env.VARIABLE_NAME}} - Access environment variables

Tool Organization

  • Tools: Individual actions defined in your schema
  • Toolsets: Reusable collections of tools in separate files
  • MCP Servers: Integration with external MCP servers

Common Use Cases

  • API Integration: Use HTTP execution to integrate REST APIs
  • DevOps Automation: Use CLI execution for system tasks
  • Configuration Management: Use File execution for config templates
  • Reporting: Use Text execution for formatted reports
  • Data Processing: Combine multiple execution types

Getting Help

If you encounter issues or have questions: Happy building with MCI! 🚀