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) orpip
Option 1: Using uv (Recommended)
First, installuv
if you haven’t already:
- macOS/Linux
- macOS (Homebrew)
- Windows
Option 2: Using pip
Verify Installation
Your First Tool
Let’s create a simple tool to get you started.1
Create a Tool Schema File
Create a file named
my-tools.mci.json
with your tool definitions:my-tools.mci.json
2
Create a Python Script
Create a Python file to use your tools:
main.py
3
Run Your Tool
Execute your Python script:
You should see:
Success: Hello, Alice! Welcome to MCI.
Quick Examples
List Available Tools
Filter Tools
Get Tool Schema
Template Placeholders
MCI supports powerful templating with placeholders:{{props.propertyName}}
- Access input properties{{env.VARIABLE_NAME}}
- Access environment variables{{input.fieldName}}
- Alias for{{props.fieldName}}
Environment variables are the recommended way to handle secrets and
configuration values.
Next Steps
Basic Usage
Learn client initialization, tool execution, and error handling patterns.
Execution Types
Explore text, file, CLI, and HTTP execution types with examples.
Advanced Features
Master environment variables, filtering, and best practices.
API Reference
Detailed documentation of all classes and methods.
Common Use Cases
- API Integration: Use HTTP execution to integrate with REST APIs
- Prompts management: Use File execution to process complex Markdown or XML prompts
- Reporting: Use Text execution to generate formatted reports
- Data Processing: Combine multiple execution types for complex workflows