Docs · static mirror — the interactive version loads with JavaScript.

Custom Agent

Call Runstack MCP from your own agent in TypeScript, Python, Go, or raw HTTP JSON-RPC.

Source: https://runstack.engineer/docs/mcp-custom-agent

Build your own agent or backend that speaks MCP to Runstack. All paths use the same MCP tools and POST https://app.runstack.engineer/mcp with Authorization: Bearer rnsk_….

TypeScript (MCP SDK)

Use the official MCP client with Streamable HTTP transport:


const client = new Client({ name: "my-agent", version: "1.0.0" })

const transport = new StreamableHTTPClientTransport(
  new URL("https://app.runstack.engineer/mcp"),
  {
    requestInit: {
      headers: { Authorization: `Bearer ${process.env.RUNSTACK_API_KEY}` },
    },
  }
)

await client.connect(transport)

const { tools } = await client.listTools()
console.log(tools)

const result = await client.callTool({
  name: "search_tools",
  arguments: { query: "github repo issues" },
})

Python (httpx)

Call tools/call directly with JSON-RPC:


MCP_URL = "https://app.runstack.engineer/mcp"
API_KEY = os.environ["RUNSTACK_API_KEY"]

headers = {
    "Content-Type": "application/json",
    "Authorization": f"Bearer {API_KEY}",
}

payload = {
    "jsonrpc": "2.0",
    "method": "tools/call",
    "params": {
        "name": "search_tools",
        "arguments": {"query": "github repo issues"},
    },
    "id": 1,
}

response = httpx.post(MCP_URL, json=payload, headers=headers, timeout=60.0)
response.raise_for_status()
print(response.json())

Go

Minimal POST example with the standard library:

package main

	"bytes"
	"encoding/json"
	"fmt"
	"net/http"
	"os"
)

func main() {
	body, _ := json.Marshal(map[string]any{
		"jsonrpc": "2.0",
		"method":  "tools/call",
		"params": map[string]any{
			"name": "search_tools",
			"arguments": map[string]string{
				"query": "notion pages",
			},
		},
		"id": 1,
	})

	req, _ := http.NewRequest(http.MethodPost, "https://app.runstack.engineer/mcp", bytes.NewReader(body))
	req.Header.Set("Content-Type", "application/json")
	req.Header.Set("Authorization", "Bearer "+os.Getenv("RUNSTACK_API_KEY"))

	res, err := http.DefaultClient.Do(req)
	if err != nil {
		panic(err)
	}
	defer res.Body.Close()
	fmt.Println("status:", res.Status)
}

curl

curl -sS -X POST "https://app.runstack.engineer/mcp" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $RUNSTACK_API_KEY" \
  -d '{
    "jsonrpc": "2.0",
    "method": "tools/call",
    "params": {
      "name": "search_tools",
      "arguments": { "query": "linear issues" }
    },
    "id": 1
  }'

Other runtimes

Any language that can send HTTPS POST with JSON can integrate: Ruby (Net::HTTP), Java (HttpClient), C# (HttpClient), etc. Follow the same JSON-RPC shape and Bearer auth.

For a local stdio bridge instead of HTTP in your IDE, use @rnsk/mcp. For Vercel AI SDK apps, use @rnsk/tools.

CORS

The /mcp endpoint allows browser clients:

Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: POST, OPTIONS
Access-Control-Allow-Headers: Content-Type, Authorization

Prefer calling Runstack from your backend so API keys are not exposed in the browser.