Integration with AI Tools
Reqs can be integrated with various AI assistants and tools that support the Model Context Protocol (MCP).
Claude Desktop Integration
Claude Desktop natively supports MCP servers. To integrate Reqs with Claude Desktop:
1. Install Reqs
First, ensure Reqs is installed and available in your PATH:
cargo install reqs
2. Configure Claude Desktop
Edit your Claude Desktop configuration file:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
Add the Reqs MCP server configuration:
{
"mcpServers": {
"reqs": {
"command": "reqs",
"args": ["--mcp"]
}
}
}
3. Configure with Options
You can add custom options to the configuration:
{
"mcpServers": {
"reqs": {
"command": "reqs",
"args": [
"--mcp",
"--timeout", "30",
"--concurrency", "20",
"--headers", "User-Agent: Claude-Desktop/1.0"
]
}
}
}
4. Restart Claude Desktop
After updating the configuration, restart Claude Desktop for the changes to take effect.
5. Using Reqs in Claude
Once configured, you can ask Claude to send HTTP requests:
Example conversations:
"Can you check the status of https://example.com?"
"Send GET requests to these URLs and tell me which ones return 200 status codes: [list of URLs]"
"Test POST requests to https://api.example.com/endpoint with JSON body {"test": "data"}"
Other MCP Clients
Reqs can work with any MCP-compatible client. The key requirements are:
- The client must support the stdio transport
- The client must implement the MCP protocol
Example: Using with MCP Client Library
If you're building your own MCP client:
const { Client } = require('@modelcontextprotocol/sdk');
const client = new Client({
name: 'my-client',
version: '1.0.0'
});
// Connect to Reqs MCP server
await client.connect({
command: 'reqs',
args: ['--mcp']
});
// List available tools
const tools = await client.listTools();
console.log(tools);
// Send requests
const result = await client.callTool('send_requests', {
requests: [
'https://example.com',
'https://github.com'
],
filter_status: [200]
});
console.log(result);
Troubleshooting
Server Not Starting
If the MCP server doesn't start:
- Verify Reqs is installed:
reqs --version - Check if the binary is in your PATH:
which reqs - Try starting manually:
reqs --mcp
Connection Issues
If the client can't connect:
- Check the configuration file syntax
- Ensure the command path is correct
- Verify file permissions on the Reqs binary
- Check client logs for error messages
Request Failures
If requests are failing:
- Test the URLs manually:
echo "URL" | reqs - Check network connectivity
- Verify timeout settings aren't too low
- Check for proxy/firewall issues
Advanced Configuration
Using with Proxy
{
"mcpServers": {
"reqs": {
"command": "reqs",
"args": [
"--mcp",
"--proxy", "http://proxy.example.com:8080"
]
}
}
}
Custom User Agent
{
"mcpServers": {
"reqs": {
"command": "reqs",
"args": [
"--mcp",
"--headers", "User-Agent: MyApp/1.0"
]
}
}
}
Rate Limiting
{
"mcpServers": {
"reqs": {
"command": "reqs",
"args": [
"--mcp",
"--delay", "100",
"--concurrency", "5"
]
}
}
}
Security Considerations
When running Reqs as an MCP server:
-
Network Access: The AI assistant will be able to send HTTP requests through Reqs. Be mindful of what networks the server has access to.
-
Credentials: If you configure headers with credentials, they will be used for all requests from the AI assistant.
-
Rate Limiting: Consider setting concurrency and delay limits to prevent overwhelming target servers.
-
Logging: Review the requests being made to ensure they align with your expectations.
Next Steps
- Explore the send_requests tool documentation
- Learn about filtering and output options
- Check out example use cases