Featured

Deploy OpenClaw in 60 seconds — 20% off logoDeploy OpenClaw in 60 seconds — 20% off

Launch OpenClaw on Hostinger in about 60 seconds and keep your agent live 24/7. Our referral link gives you 20% off, no coupon code needed.

Launch on Hostinger
Run your Hermes agent on Hostinger, fully managed logoRun your Hermes agent on Hostinger, fully managed

Launch Hermes on Hostinger in one click, fully managed, no VPS knowledge needed. Use code ZACAARON10 for 10% off.

Launch on Hostinger
Crawl and scrape any site into clean data, 10% off logoCrawl and scrape any site into clean data, 10% off

Firecrawl crawls and scrapes any site into clean markdown for your agent. Get 1,000 free credits, and new users get 10% off their first purchase.

Try Firecrawl free
6,000+ web scrapers for your AI agent, start free logo6,000+ web scrapers for your AI agent, start free

Apify gives your agent live web data: 6,000+ prebuilt scrapers and actors, MCP-ready. Sign up free with $5 in usage credits.

Try Apify free
One API to scrape, enrich, and extract the internet. logoOne API to scrape, enrich, and extract the internet.

Context.dev gives your agents a single API to scrape, enrich, and extract live web data — no proxies, no parsers, no maintenance.

Start building free
SetupClaw: done-for-you OpenClaw for founders & exec teams logoSetupClaw: done-for-you OpenClaw for founders & exec teams

White-glove OpenClaw for founders and exec teams (4–50+ employees): we install, harden, integrate your tools, and maintain it — secured from day one.

Get it set up for you
SEO data APIs for your agent, $1 free credit logoSEO data APIs for your agent, $1 free credit

DataForSEO gives your agent live access to SERP results, keyword data, backlinks, and on-page SEO data through one API. New accounts get a $1 credit, good for up to 20,000 keyword or backlink lookups.

Try DataForSEO free
Reach 48,000+ AI builders

A flat monthly placement in front of developers actively installing AI tools. No lock-in, cancel anytime.

Advertise here

Works with

Claude CodeClaude DesktopCursorVS CodeClineCodex CLIOpenClaw+ any MCP client

Install to Claude Code

This server doesn't publish a one-line install command. Follow the setup in the source repository.

Summary

Provides tools for AI assistants to access Amanahfy APIs, enabling campaign details and IP geolocation lookups.

README.md

Amanahfy AI MCP Server

A production-ready Model Context Protocol (MCP) server that provides AI tools & resources with access to Amanahfy APIs & services. Built with TypeScript and following clean architecture principles.

![Node.js](https://nodejs.org/) ![TypeScript](https://www.typescriptlang.org/)

🚀 Features

  • Dual Transport Support: STDIO (Claude Desktop) and HTTP (testing/development)
  • Clean Architecture: 5-layer architecture with separation of concerns
  • CLI Tools: Command-line interface for direct API testing
  • Resource Access: URI-based resource references (campaign://slug, ip://address)
  • Type Safety: Full TypeScript implementation with Zod validation

📋 Prerequisites

  • Node.js (>=18.0.0): Download
  • Git: For version control
  • Claude Desktop: For MCP integration (Optional)

⚡ Quick Start

1. Installation

# Clone the repository
git clone <your-repo-url>
cd amanahfy-ai-mcp

# Install dependencies
npm install

# Build the project
npm run build

2. Claude Desktop Integration

Add to your Claude Desktop configuration (claude_desktop_config.json):

{
    "mcpServers": {
        "amanahfy-ai-mcp": {
            "command": "node",
            "args": [
                "C:\\path\\to\\campaign-agent-mcp-server\\dist\\index.js"
            ],
            "env": {
                "TRANSPORT_MODE": "stdio"
            }
        }
    }
}

3. Test the Connection

Restart Claude Desktop completely, then ask Claude:

  • "Look up the campaign gaza-100k-in-72hrs"
  • "What's the location of IP 8.8.8.8?"

💻 CLI Usage

Test functionality directly from the command line:

Campaign Commands

# Get campaign details
npm run cli -- get-campaign-details gaza-100k-in-72hrs

# With custom options
npm run cli -- get-campaign-details gaza-100k-in-72hrs --timeout 5000 --retries 1

🏗️ Architecture

The server follows a clean 5-layer architecture:

├── CLI Layer (src/cli/)           # Command-line interfaces
├── Tools Layer (src/tools/)       # MCP tool definitions
├── Resources Layer (src/resources/) # MCP resource handlers
├── Controllers Layer (src/controllers/) # Business logic
├── Services Layer (src/services/) # External API integration
└── Utils Layer (src/utils/)       # Shared utilities

⚙️ Configuration

Environment Variables

Create a .env file in the project root:

# Transport Configuration
TRANSPORT_MODE=stdio
PORT=8000
DEBUG=false
NODE_ENV=production

# API Configuration
AMANAHFY_API_BASE=https://api.amanahfy.com/api

# Optional API Keys
# IPAPI_API_TOKEN=your_api_token_here

Available Scripts

# Development
npm run build          # Compile TypeScript
npm run dev:stdio      # Run in STDIO mode with debug
npm run dev:http       # Run in HTTP mode with debug

# MCP Server Modes
npm run mcp:stdio      # STDIO transport (for Claude Desktop)
npm run mcp:http       # HTTP transport (for testing)

# Testing & Development
npm run cli            # CLI mode
npm run test           # Run tests
npm run lint           # Run ESLint
npm run format         # Format with Prettier

# Debugging
npm run mcp:inspect    # Launch with MCP Inspector

🧪 Testing & Development

MCP Inspector (Recommended)

Test your MCP server with the official inspector:

# Launch server with inspector
npm run mcp:inspect

# Then open: http://localhost:3000/mcp

Manual Testing

# Test HTTP mode
npm run mcp:http

# Test specific endpoints
curl http://localhost:8000/mcp

CLI Testing

# Test campaign lookup
npm run cli -- get-campaign-details gaza-100k-in-72hrs

# Test IP lookup
npm run cli -- get-ip-details 8.8.8.8

🔧 Troubleshooting

Common Issues

  1. "Not valid JSON" error
  • Ensure no console output is interfering with STDIO mode
  • Check that TRANSPORT_MODE=stdio in Claude Desktop config
  1. Module not found errors
  • Run npm run build after any code changes
  • Verify all dependencies are installed: npm install
  1. API timeout errors
  • Check network connectivity
  • Increase timeout values in tool parameters
  • Verify API endpoints are accessible
  1. Claude Desktop connection issues
  • Use absolute paths in config
  • Restart Claude Desktop completely after config changes
  • Check Claude Desktop logs for detailed error messages

Debug Mode

Enable detailed logging:

DEBUG=true
NODE_ENV=development

---

Need help? Open an issue or check the troubleshooting section above.

See related servers & alternatives →

Related MCP servers

Browse all →

Related guides

Hand-picked reading to help you choose and use AI & ML servers.