amanahfy-ai-mcp

amanahfy-ai-mcp

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

Category
Visit Server

README

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 TypeScript

๐Ÿš€ 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
  2. Module not found errors

    • Run npm run build after any code changes
    • Verify all dependencies are installed: npm install
  3. API timeout errors

    • Check network connectivity
    • Increase timeout values in tool parameters
    • Verify API endpoints are accessible
  4. 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.

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured