CLI, SDKs & MCP
Three ways to interact with MUXI
MUXI provides three interfaces: the CLI for managing your server and formations, SDKs for building applications, and MCP for connecting AI-native tools like Claude Desktop and Cursor.
CLI
For: Managing MUXI
- Deploy and manage formations
- Configure secrets
- Monitor logs and health
- Server administration
muxi deploy
muxi secrets setup
muxi logs my-assistant
SDKs
For: Building applications
- Chat with your agents
- Stream responses
- Manage sessions and memory
- Integrate into your apps
client = FormationClient(url="...")
for event in client.chat_stream({"message": "Hi"}):
print(event.get("text"), end="")
MCP
For: AI-native tools
- Use from Claude Desktop or Cursor
- 33 tools auto-generated from your API
- Same auth as REST
- Zero wrapper code
{
"type": "streamable-http",
"url": "http://localhost:7890/draft/my-formation/mcp",
"headers": {
"X-Muxi-Client-Key": "fmc_..."
}
}
Which should I use?
| I want to... | Use |
|---|---|
| Deploy a formation | CLI |
| Set up API keys and secrets | CLI |
| Check formation logs | CLI |
| Start/stop formations | CLI |
| Build a chatbot UI | SDK |
| Integrate agents into my app | SDK |
| Stream responses to users | SDK |
| Manage user sessions | SDK |
| Use agents from Claude Desktop | MCP |
| Use agents from Cursor | MCP |
| Give an AI assistant access to my formation | MCP |
Most projects use both CLI and SDKs: CLI for deployment and ops, SDKs for application code. Add MCP when you want AI assistants to use your formation as a tool.
CLI Quick Start
Install
brew install muxi-ai/tap/muxi
curl -fsSL https://muxi.org/install | sudo bash
powershell -c "irm https://muxi.org/install | iex"
Essential Commands
# Create a new formation
muxi new formation my-assistant
# Set up secrets (API keys)
muxi secrets setup
# Run locally for development
muxi up
# Deploy to production server
muxi deploy --profile production
# View logs
muxi logs my-assistant --follow
# List all formations
muxi remote list
SDK Quick Start
Install
pip install muxi-client
npm install @muxi-ai/muxi-typescript
go get github.com/muxi-ai/muxi-go
Chat with Your Agent
from muxi import FormationClient
client = FormationClient(
server_url="http://localhost:7890",
formation_id="my-assistant",
client_key="<your-client-key>",
mode="draft",
)
for event in client.chat_stream({"message": "Hello!"}, user_id="user_123"):
if event.get("type") == "text":
print(event.get("text"), end="")
import { FormationClient } from "@muxi-ai/muxi-typescript";
const client = new FormationClient({
serverUrl: "http://localhost:7890",
formationId: "my-assistant",
clientKey: "<your-client-key>",
mode: "draft",
});
for await (const event of client.chatStream({ message: "Hello!" }, "user_123")) {
if (typeof event.token === "string") process.stdout.write(event.token);
}
client := muxi.NewFormationClient(&muxi.FormationConfig{
ServerURL: "http://localhost:7890",
FormationID: "my-assistant",
ClientKey: "<your-client-key>",
Mode: "draft",
})
stream, _ := client.ChatStream(ctx, &muxi.ChatRequest{
Message: "Hello!",
UserID: "user_123",
})
for chunk := range stream {
if token, ok := chunk.Raw["token"].(string); ok {
fmt.Print(token)
}
}