Skip to main content

Agent SDK Quickstart

Benchmarked against: Anthropic — Agent SDK Quickstart Time: 10 minutes to a working agent Prerequisites: Python 3.11+, Claude Code or LangGraph installed

This quickstart gets you from zero to a functioning SuperPortia agent. Choose your line and follow the steps.


Option A: Line 1 — Claude Code agent

The fastest path. Claude Code CLI is already a complete agent.

1. Install Claude Code

# Claude Code CLI
npm install -g @anthropic-ai/claude-code

2. Configure MCP servers

Add SuperPortia MCP servers to your Claude Code config:

{
"mcpServers": {
"cloud-ub": {
"url": "https://your-worker.workers.dev/mcp"
},
"local-ubi": {
"command": "python",
"args": ["-m", "ub.mcp_server"],
"env": {
"SP_SHIP_ID": "SS1",
"SP_AGENT_ID": "Mac CLI 小克"
}
}
}
}

3. Add CLAUDE.md

Create a CLAUDE.md in your project root with agent identity and rules. See CLAUDE.md + PD for the template.

4. Test

claude
# In the session:
# > agent_heartbeat()
# > search_brain("test")

Your Line 1 agent is online.


Option B: Line 2 — LangGraph agent

Build a custom agent with LangGraph.

1. Install dependencies

pip install langgraph langgraph-checkpoint-sqlite langchain-mcp-adapters

2. Create the agent

# superportia_agent.py
from langgraph.graph import StateGraph, MessagesState
from langgraph.prebuilt import ToolNode

# Define tools (MCP adapters or custom)
tools = [...] # Your MCP tool bindings

# Build the graph
graph = StateGraph(MessagesState)
graph.add_node("agent", agent_node)
graph.add_node("tools", ToolNode(tools))
graph.add_edge("agent", "tools")
graph.add_edge("tools", "agent")

# Compile
app = graph.compile()

3. Run

result = app.invoke({"messages": [("user", "Search UB for architecture docs")]})

See Python SDK and LangGraph Quickstart for complete examples.


What both lines need

Regardless of line, every SuperPortia agent needs:

RequirementHow
Cloud UB accessMCP server configured
Ship identitySP_SHIP_ID set
Agent identitySP_AGENT_ID set
Heartbeat on startagent_heartbeat()
Constitution knowledgeRules loaded or referenced
Cost awarenessEngine selection discipline

Next steps

PathPage
Deep dive Line 1TypeScript Agent SDK
Deep dive Line 2Python SDK
LangGraph from scratchLangGraph Quickstart
Move between linesLine Migration