MCP Server for HTTP requests with profile management - multiple authentication types, response caching, and flexible request handling
|
All checks were successful
Publish Package / publish (push) Successful in 25s
🐛 Bug Fix: - Fix TypeScript compilation error TS18048 in CI build - Add null check for tool.description in tests 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> |
||
|---|---|---|
| .forgejo/workflows | ||
| src | ||
| .gitignore | ||
| CHANGELOG.md | ||
| package-lock.json | ||
| package.json | ||
| README.md | ||
| tsconfig.json | ||
| vitest.config.ts | ||
🌐 http-mcp
MCP Server for HTTP requests and API testing.
🆕 What's New in v2.0.0
Complete Refactor with Enhanced Architecture
- 🏗️ Modular Structure: Split into focused modules (types, tool-definitions, handlers, service) - 79% code reduction in index.ts
- 🔒 100% Type Safety: Eliminated all
anytypes with proper TypeScript interfaces - 📚 Complete Documentation: Full JSDoc coverage for all public APIs
- 🧪 Comprehensive Testing: 21 unit tests with 100% pass rate
- 📦 Updated Dependencies: MCP SDK upgraded from 0.5.0 → 1.20.0
- 🚀 Profile Management: Save and reuse request configurations with authentication
- 💾 Response Caching: Built-in caching for GET requests with configurable TTL
- 🔐 Multiple Auth Types: Bearer, Basic, and API Key authentication support
See CHANGELOG.md for complete details.
Features
HTTP Methods
- 🌐
request- Generic HTTP request (GET, POST, PUT, DELETE, PATCH) - 📊
get_json- GET request expecting JSON - 📝
post_json- POST JSON data - 🍪
request_with_cookies- Request with custom cookies
Authentication
- 🔐 Auth profiles (Basic, Bearer, OAuth)
- 🔑 API key support
- 🍪 Cookie management
- 📋 Header templates
Advanced Features
- 💾 Response caching
- 🔄 Automatic retry with exponential backoff
- ⏱️ Timeout management
- 📊 Request/Response logging
- 🔍 Response validation
Profiles
Save common configurations as profiles for quick access.
Installation
npm install
npm run build
Configuration
Set environment variables:
HTTP_TIMEOUT- Default timeout in ms (default: 30000)HTTP_CACHE_TTL- Cache TTL in seconds (default: 300)
Usage
npm start
Examples
Simple GET request
{
"url": "https://api.example.com/users",
"method": "GET"
}
POST with authentication
{
"url": "https://api.example.com/users",
"method": "POST",
"headers": {
"Authorization": "Bearer token123"
},
"body": {
"name": "John Doe"
}
}
License
MIT