Vibe SDK
High-level Python interface for running Vibe agents.
This repository directory also owns the shared agent harness used across Vibe
products. Its Rust Harness Core, language-specific Harness Runtimes, protocol
specification, and architecture documents live under harness/.
The SDK gives you:
Agentand stateful async/sync sessions- Pydantic-based tool authoring
- Built-in filesystem tools
- Client-handled tools for UI- or host-dependent actions, such as asking the user a question
- Skills: reusable instruction sets advertised in the prompt and loaded on demand
- MCP server integration — discover a server's tools and expose them to the agent
For architecture and design references, see ARCHITECTURE.md
and documentation/INDEX.md. Start with
harness/docs/README.md for the shared harness.
The Vibe-specific Runtime scaffold ships with the Python Harness Runtime and is
documented in
harness/runtimes/python/python/mistralai_rust_harness/vibe/README.md.
Advanced raw task-protocol examples live in examples/advanced_task_protocol_examples. They are not the primary public SDK API, but they are useful end-to-end probes for local, HTTP, and workflow execution.
Quick Start
Use run_to_completion() when you just want the final task state for one turn:
from mistralai.vibe.sdk import Agent, AgentConfig
from mistralai.vibe.sdk.providers.completion import MistralCompletionConfig
agent = Agent(
config=AgentConfig(
completion=MistralCompletionConfig(model="mistral-large-latest"),
system_prompt="You are a concise assistant.",
)
)
async with agent.session() as session:
state = await session.run_to_completion("Hello")
print(state.output)
Use run() when the host needs streaming updates, callback requests, or direct
access to task protocol events:
from mistralai.vibe.sdk import Agent, AgentConfig
from mistralai.vibe.sdk.execution_record.patching.json_patch import apply_patches
from mistralai.vibe.sdk.execution_record.state import TaskState
from mistralai.vibe.sdk.providers.completion import MistralCompletionConfig
from mistralai.vibe.sdk.transports.events import TaskResultEvent, TaskStateUpdateEvent
agent = Agent(
config=AgentConfig(
completion=MistralCompletionConfig(model="mistral-large-latest"),
system_prompt="You are a concise assistant.",
)
)
async with agent.session() as session:
state = TaskState(input="Hello")
async for event in session.run("Hello"):
if isinstance(event, TaskStateUpdateEvent):
state = apply_patches(state, event.payload.patches)
elif isinstance(event, TaskResultEvent):
state = event.payload.result
print(state.output)
Tool annotations
Use ToolResult to return metadata to non-model consumers while keeping the
model-visible result compact:
from pydantic import BaseModel
from mistralai.vibe.sdk.capabilities import ToolResult, tool
class EditFileArgs(BaseModel):
path: str
previous_content: str
class EditFileResult(BaseModel):
lines_changed: int
@tool(name="edit_file", description="Edit a file", input_schema=EditFileArgs)
def edit_file(args: EditFileArgs) -> ToolResult[EditFileResult]:
return ToolResult(
value=EditFileResult(lines_changed=2),
annotations={"example.file_before": args.previous_content},
)
Annotations are stored on the corresponding task-result history entry and are not included in the tool result sent to the model.
Skills
Skills let an agent discover short task-specific summaries up front and load the
full instructions only when needed through the builtin skill tool.
from mistralai.vibe.sdk import Agent, AgentConfig, SkillDefinition
from mistralai.vibe.sdk.providers.completion import MistralCompletionConfig
agent = Agent(
config=AgentConfig(
completion=MistralCompletionConfig(model="mistral-large-latest"),
skills=[
SkillDefinition(
name="interview",
description="Use when running a structured user interview.",
content="Ask one question at a time and summarize decisions at the end.",
)
],
)
)
MCP Servers
Add MCP servers in the mcps field of AgentConfig as a dict mapping a short local name
to each server's config.
See the agent README for details on MCP support implementation.
Local (stdio) servers
Use StdioMcpConfig to launch a local subprocess and talk to it over stdio:
from mistralai.vibe.sdk import Agent, AgentConfig
from mistralai.vibe.sdk.capabilities.mcp import StdioMcpConfig
agent = Agent(
config=AgentConfig(
model="mistral-large-latest",
mcps={
"demo": StdioMcpConfig(command="python", args=["demo_mcp_server.py"]),
},
)
)
Secrets are never stored in the config. To pass host environment variables into
the subprocess, list their names with env_key_names; the values are read from
the host at launch:
StdioMcpConfig(
command="my-mcp-server",
args=[],
env_key_names=["MY_SERVER_TOKEN"],
timeout_ms=30_000,
)
Connector-backed servers
Use ConnectorMcpConfig to reach a Mistral connector instead of a local
subprocess. By default it uses the SDK transport, reading the API key from
MISTRAL_API_KEY. ConnectorMcpConfig accepts:
connector_id_or_name— the connector to reach, by id or name (required).credentials_name— selects which named credential set the connector uses to resolve, list, and call tools. Leave unset to use the connector's default credential resolution.transport— how to reach the connector. Two modes are available:
-
ConnectorMcpSdkTransportreaches the connector through the public Mistral SDK. Accepts:api_key_env_var— name of the host environment variable holding the Mistral API key. The value is read at runtime, so the secret is never stored in the serialized config. Defaults toMISTRAL_API_KEY.server_url— override the Mistral API base URL. Optional; unset uses the SDK default.timeout_ms— request timeout in milliseconds passed to the Mistral client. Optional; unset uses the SDK default.
-
ConnectorMcpDirectTransportreaches the connector directly over JSON-RPC HTTP, bypassing the public SDK. Accepts:base_url— base URL of the connectors service to call (required).origin_service— name of the calling service, used to identify the caller (required).scoped_headers— extra HTTP headers sent with each request. Defaults to an empty mapping.timeout_ms— request timeout in milliseconds. Must be greater than 0. Defaults to30000.mcp_path_template— endpoint path, relative tobase_url, of the direct MCP endpoint. May include a{{connector_id}}placeholder that is substituted at runtime. Optional; rarely overridden. Defaults to/connectors-gateway/{{connector_id}}/mcp.
Example of a connector config for direct transport:
from mistralai.vibe.sdk.capabilities.mcp import (
ConnectorMcpConfig,
ConnectorMcpDirectTransport,
)
ConnectorMcpConfig(
connector_id_or_name="<your-connector-id-or-name>",
transport=ConnectorMcpDirectTransport(
base_url="<base-url>",
origin_service="<my-service>",
scoped_headers={"x-tenant-id": "acme"},
timeout_ms=30_000,
),
)
Remote HTTP servers
Use HttpMcpConfig to connect to a standard MCP server over Streamable HTTP:
from mistralai.vibe.sdk import Agent, AgentConfig
from mistralai.vibe.sdk.capabilities.mcp import HttpMcpConfig
agent = Agent(
config=AgentConfig(
model="mistral-large-latest",
mcps={
"remote": HttpMcpConfig(url="https://mcp.example.com/mcp"),
},
)
)
HttpMcpConfig accepts:
url— the MCP server endpoint (required).scoped_headers— extra HTTP headers sent on every request. Values may be literals or{{ENV_VAR}}templates resolved from the host environment at request time, so secrets are never stored in the serialized config.timeout_ms— timeout in milliseconds for the MCP handshake andlist_toolsrequests. Defaults to30000.sse_read_timeout_ms— read timeout in milliseconds for streaming tool responses (SSE). Defaults to300000(5 min). Use this to tune long-running streaming tool calls.
See agent/ for how MCP tools are wired into the runtime, and examples/basic_repl for a runnable stdio demo.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mistralai_vibe_sdk-0.13.2.tar.gz.
File metadata
- Download URL: mistralai_vibe_sdk-0.13.2.tar.gz
- Upload date:
- Size: 194.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
194568ebdeb9eda142804ba21896e37549e9bf0094486d59a9d2176883d3f870
|
|
| MD5 |
109d0da08cc40644786522ba76df382d
|
|
| BLAKE2b-256 |
b07432c684dfef9f89cd8bd53184abf3b1543572a290d958bd75e5555c16746e
|
Provenance
The following attestation bundles were made for mistralai_vibe_sdk-0.13.2.tar.gz:
Publisher:
release.yml on mistralai/vibe-sdk
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mistralai_vibe_sdk-0.13.2.tar.gz -
Subject digest:
194568ebdeb9eda142804ba21896e37549e9bf0094486d59a9d2176883d3f870 - Sigstore transparency entry: 2498566442
- Sigstore integration time:
-
Permalink:
mistralai/vibe-sdk@0005c0e6faec1821ad14afab85260e091f702c6d -
Branch / Tag:
refs/tags/v0.13.2 - Owner: https://github.com/mistralai
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@0005c0e6faec1821ad14afab85260e091f702c6d -
Trigger Event:
release
-
Statement type:
File details
Details for the file mistralai_vibe_sdk-0.13.2-py3-none-any.whl.
File metadata
- Download URL: mistralai_vibe_sdk-0.13.2-py3-none-any.whl
- Upload date:
- Size: 280.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
54770cbf6f6a78931b4f0505aa604dd189e3442414123dda18c9cfa0a14a5b2e
|
|
| MD5 |
b4f9de39349a68e259e75c9ded005f54
|
|
| BLAKE2b-256 |
6c11a5595bb3ef699d1319c70297060b118802a13dab64a86fcd4dbb6af9a1f4
|
Provenance
The following attestation bundles were made for mistralai_vibe_sdk-0.13.2-py3-none-any.whl:
Publisher:
release.yml on mistralai/vibe-sdk
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mistralai_vibe_sdk-0.13.2-py3-none-any.whl -
Subject digest:
54770cbf6f6a78931b4f0505aa604dd189e3442414123dda18c9cfa0a14a5b2e - Sigstore transparency entry: 2498566445
- Sigstore integration time:
-
Permalink:
mistralai/vibe-sdk@0005c0e6faec1821ad14afab85260e091f702c6d -
Branch / Tag:
refs/tags/v0.13.2 - Owner: https://github.com/mistralai
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@0005c0e6faec1821ad14afab85260e091f702c6d -
Trigger Event:
release
-
Statement type: