CleanTextLab
Bereinigen Sie unordentlichen Text in Sekunden. Schnelle Browser-Tools für Zeilenumbrüche, Akzente, Listen, Telefonnummern, SMS und mehr. Keine Konten und keine Uploads.
Docs
Strands Agents
Integriere CleanTextLab MCP mit Strands Agents.
Voraussetzungen
- Python 3.10+
- CleanTextLab Pro API-Key
- Strands Agents installiert
python -m venv .venv
source .venv/bin/activate
pip install strands-agents
Option A: Lokales MCP via npx (empfohlen für lokale Entwicklung)
from strands import Agent
from strands.tools.mcp import MCPClient
from mcp import stdio_client, StdioServerParameters
cleantextlab = MCPClient(
lambda: stdio_client(
StdioServerParameters(
command="npx",
args=["-y", "cleantextlab-mcp"],
env={"CLEANTEXTLAB_API_KEY": "ctl_live_YOUR_KEY"},
)
)
)
with cleantextlab:
agent = Agent(tools=cleantextlab.list_tools_sync())
agent("Remove line breaks from: Hello\nworld")
Option B: Gehostetes MCP (SSE)
from strands import Agent
from strands.tools.mcp import MCPClient
from mcp import sse_client, SSEServerParameters
cleantextlab = MCPClient(
lambda: sse_client(
SSEServerParameters(
url="https://cleantextlab.com/api/mcp/sse",
headers={"x-api-key": "ctl_live_YOUR_KEY"},
)
)
)
with cleantextlab:
agent = Agent(tools=cleantextlab.list_tools_sync())
agent("Generate an ASCII tree from: src/app/page.tsx")
Warum MCP für Agenten?
- Deterministische Ausgabe für Formatierungsaufgaben
- Weniger Token durch Auslagerung schwerer Operationen
- Wiederverwendbare Tools in Agent-Workflows
Nächste Schritte
- MCP-Guide: /docs/mcp-setup
- API-Referenz: /docs/api
- Automation Hub: /automation