INSPECTOR_GUIDE.md•2.48 kB
# MCP Inspector Quick Start Guide
## Prerequisites
Make sure your Zocialeye MCP server is running:
```bash
npm start
# Should see: "zocialeye-mcp v1.0.0 running on port 3000"
```
## Using the Inspector UI
1. **Start the Inspector**:
```bash
npx @modelcontextprotocol/inspector
```
2. **In the Inspector UI** (opens at http://localhost:6274):
- **Transport**: Select `Streamable HTTP` (NOT SSE!)
- **Server URL**: `http://localhost:3000/12345/mcp` (replace 12345 with your campaign ID)
- **Bearer Token**: Enter `YOUR_API_KEY` (your Zocialeye API key - Inspector will add "Bearer " prefix automatically)
- Click **Connect**
3. **Test the tools**:
- You should see 6 available tools listed
- Try calling `get_campaign_categories` to test
## Using the Inspector CLI
```bash
# List available tools
npx @modelcontextprotocol/inspector --cli \
http://localhost:3000/12345/mcp \
--transport streamable-http \
--header "Authorization: Bearer YOUR_API_KEY" \
--method tools/list
# Call a specific tool
npx @modelcontextprotocol/inspector --cli \
http://localhost:3000/12345/mcp \
--transport streamable-http \
--header "Authorization: Bearer YOUR_API_KEY" \
--method tools/call \
--tool-name get_campaign_categories
# Get campaign wordcloud
npx @modelcontextprotocol/inspector --cli \
http://localhost:3000/12345/mcp \
--transport streamable-http \
--header "Authorization: Bearer YOUR_API_KEY" \
--method tools/call \
--tool-name get_campaign_wordcloud
```
## Troubleshooting
### "Connection Error" in Inspector
- ✅ Ensure server is running: `curl http://localhost:3000/health`
- ✅ Check you selected **Streamable HTTP** (not SSE!)
- ✅ Verify URL is correct: `http://localhost:3000/{campaign_id}/mcp`
- ✅ Confirm campaign ID is numeric (digits only)
- ✅ Check Bearer token is entered in the Authorization field
### "401 Unauthorized"
- Verify Authorization header is present with Bearer prefix
- Ensure campaign ID in URL is numeric
- Confirm API key is valid
### "404 Not Found"
- Double-check the URL path: `/{campaign_id}/mcp`
- Ensure you're using campaign ID, not some other identifier
## Quick Test
```bash
# Test with curl
curl -X POST \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}' \
http://localhost:3000/12345/mcp
```
Replace `12345` with your campaign ID and `YOUR_API_KEY` with your actual API key.