Sponsored by Deepsite.site

MCP Server - Natural Language API Gateway for z-ap-server

Created By
aishwaryaeaswar9 months ago
Content

MCP Server - Natural Language API Gateway for z-ap-server

This middleware service allows you to interact with the z-ap-server APIs using natural language queries through a FastAPI server. It integrates with Claude desktop on your Mac to process natural language commands.

Setup and Installation

  1. Install the required dependencies:

    pip install -r requirements.txt
    
  2. Configure environment variables (in .env file):

    Z_AP_SERVER_BASE_URL=http://localhost/z-ap-server
    API_USERNAME=your_username
    API_PASSWORD=your_password
    ANTHROPIC_API_KEY=  # Optional, leave empty to use Claude desktop
    
  3. Start the server:

    uvicorn main:app --reload
    

Using Natural Language Interface

The MCP server provides a natural language interface to interact with the z-ap-server's transaction APIs. You can use the /natural_language_request endpoint to send natural language queries.

With Claude Desktop

Since you have Claude desktop installed on your Mac, the system will automatically use the local Claude app to process your natural language commands when no API key is provided.

Example Queries

Here are some examples of natural language queries you can use:

  • "Show me all transactions"
  • "Get transaction with ID 3770211"
  • "Create a new transaction for user 302960 with amount 50"
  • "Update transaction 3770212 to set amount to 25"
  • "Delete transaction 3770203"
  • "Show me the list of users"
  • "What are the transaction types?"

API Endpoint

curl -X POST http://127.0.0.1:8000/natural_language_request \
  -H "Content-Type: application/json" \
  -d '{"user_input": "Show me all transactions"}'

Web Interface

For a more user-friendly experience, you can access the HTML interface at:

http://127.0.0.1:8000/public/login_test.html

How It Works

  1. Your natural language request is sent to the MCP server
  2. The server uses Claude desktop to interpret your request
  3. Claude maps your request to the appropriate z-ap-server API endpoint
  4. The server makes the API call with the proper authentication
  5. Results are returned in a user-friendly format

Available API Actions

The following actions are available through natural language:

  • get_transactions: Retrieve a list of transactions
  • get_transaction: Retrieve a specific transaction by ID
  • create_transaction: Create a new transaction
  • update_transaction: Update an existing transaction
  • delete_transaction: Delete a transaction
  • get_users: Retrieve a list of users
  • get_transaction_types: Retrieve a list of transaction types

Security Notes

  • The JWT bearer token is currently hardcoded in the application for demonstration purposes
  • In a production environment, implement proper token management and security practices
Recommend Servers
TraeBuild with Free GPT-4.1 & Claude 3.7. Fully MCP-Ready.
Context7Context7 MCP Server -- Up-to-date code documentation for LLMs and AI code editors
EdgeOne Pages MCPAn MCP service designed for deploying HTML content to EdgeOne Pages and obtaining an accessible public URL.
DeepChatYour AI Partner on Desktop
CursorThe AI Code Editor
TimeA Model Context Protocol server that provides time and timezone conversion capabilities. This server enables LLMs to get current time information and perform timezone conversions using IANA timezone names, with automatic system timezone detection.
ChatWiseThe second fastest AI chatbot™
MiniMax MCPOfficial MiniMax Model Context Protocol (MCP) server that enables interaction with powerful Text to Speech, image generation and video generation APIs.
AiimagemultistyleA Model Context Protocol (MCP) server for image generation and manipulation using fal.ai's Stable Diffusion model.
Zhipu Web SearchZhipu Web Search MCP Server is a search engine specifically designed for large models. It integrates four search engines, allowing users to flexibly compare and switch between them. Building upon the web crawling and ranking capabilities of traditional search engines, it enhances intent recognition capabilities, returning results more suitable for large model processing (such as webpage titles, URLs, summaries, site names, site icons, etc.). This helps AI applications achieve "dynamic knowledge acquisition" and "precise scenario adaptation" capabilities.
Serper MCP ServerA Serper MCP Server
MCP AdvisorMCP Advisor & Installation - Use the right MCP server for your needs
Playwright McpPlaywright MCP server
BlenderBlenderMCP connects Blender to Claude AI through the Model Context Protocol (MCP), allowing Claude to directly interact with and control Blender. This integration enables prompt assisted 3D modeling, scene creation, and manipulation.
Howtocook Mcp基于Anduin2017 / HowToCook (程序员在家做饭指南)的mcp server,帮你推荐菜谱、规划膳食,解决“今天吃什么“的世纪难题; Based on Anduin2017/HowToCook (Programmer's Guide to Cooking at Home), MCP Server helps you recommend recipes, plan meals, and solve the century old problem of "what to eat today"
Tavily Mcp
Amap Maps高德地图官方 MCP Server
Visual Studio Code - Open Source ("Code - OSS")Visual Studio Code
Jina AI MCP ToolsA Model Context Protocol (MCP) server that integrates with Jina AI Search Foundation APIs.
WindsurfThe new purpose-built IDE to harness magic
Baidu Map百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。