Nxs
Pipe-friendly CLI for Anthropic Messages API with MCP server passthrough
Installation
npx nxsAsk AI about Nxs
Powered by Claude · Grounded in docs
I know everything about Nxs. Ask me about installation, configuration, usage, or troubleshooting.
0/500
Reviews
Documentation
nxs
A pipe-friendly CLI that sends conversations to the Anthropic Messages API with MCP server passthrough.
nxs works in two modes: an interactive chat TUI for multi-turn conversations, and a pipe mode that reads from stdin for scripting and automation. MCP servers are passed directly to the API — no local MCP client needed.
Requirements
- Go 1.21+
- An Anthropic API key
Install
go install github.com/ironystock/nxs/cmd/nxs@latest
Or build from source:
git clone https://github.com/ironystock/nxs.git
cd nxs
go build -o bin/nxs cmd/nxs/main.go
Setup
Set your API key as an environment variable:
export ANTHROPIC_API_KEY="sk-ant-..."
Usage
Interactive chat
nxs
Launches a chat TUI. Type messages and press Enter to send. Shift+Enter for newlines. Ctrl+C or Esc to quit.
Pipe mode
echo "explain this error" | nxs
Reads stdin, sends it to the API, and prints the response to stdout.
Combine stdin with a query:
cat main.go | nxs "find bugs in this code"
git diff | nxs "write a commit message for this diff"
Output raw JSON instead of text:
echo "hello" | nxs --json
Flags
| Flag | Description |
|---|---|
--model | Override the model (default: claude-sonnet-4-5-20250514) |
--json | Print full API response as JSON (pipe mode only) |
--profile | Config profile (not yet implemented) |
How MCP works in nxs
nxs passes MCP server configurations directly to the Anthropic Messages API using the mcp_servers field. The API connects to MCP servers and executes tools server-side. When the API responds with tool use blocks, nxs automatically handles the multi-turn loop until the final response is ready.
License
MIT
