Sponsored by Deepsite.site

Ntealan Apis Mcp Server

Created By
Levis00458 months ago
A modular, extensible Model Context Protocol (MCP) server for NTeALan REST APIs dictionaries and contributions. This project provides a unified interface for managing dictionary data, articles, and user contributions, and is designed for easy integration and extension.
Content
NTeALan REST APIs MCP Server

NTeALan dictionaries MCP Server is a modular, extensible Model Context Protocol (MCP) server for NTeALan REST APIs dictionaries and contributions. This project provides a unified interface for managing dictionary data, articles, and user contributions, and is designed for easy integration and extension.

The project is deployed at https://apis.ntealan.net/ntealan/mcpserver. Add /sse path to connect to a MCP client. Only resource actions can be used now.

⚠️ This dev endpoint could be unavailable sometimes. Just create an issue and we will work on it.

smithery badge

PyPI MIT licensed Documentation


🦜 Table of Contents


🦜 Features

  • Dictionary Management: Create, update, delete, and retrieve dictionaries and their metadata.
  • Article Management: Manage articles within dictionaries, including statistics and filtering.
  • Contribution Management: Track and manage user contributions to articles and dictionaries.
  • Extensible MCP Server: Easily add new resources and tools.
  • Async Support: Built on top of fastmcp and aiohttp for high performance.
  • OpenAPI-like Resource Registration: Register resources and tools with URIs and tags.

🦜 Getting Started

Prerequisites

Installation

Installing via pip

Clone the repository and install dependencies:

git clone https://github.com/Levis0045/ntealan-apis-mcp-server.git
cd ntealan-apis-mcp-server
pip install .

(Optional) Install and use uv for faster dependency management

If you want faster installs and modern Python packaging, you can use uv in the ntealan-apis-mcp-server directory:

uv sync

Running the Server

To start the MCP server:

python -m ntealanmcp -t stdio

Or, if you have uv installed, you can run server command:

ntealanmcp -t stdio

The server will run using the Server-Sent Events (sse) transport by default at this endpoint http://127.0.0.1:8000/sse. You can modify the transport in main.py if needed.


🦜 Project Structure

ntealan-api/
├── src/
│   └── ntealan_apis_mcp/
│       ├── main.py
│       ├── models/
│       │   ├── article.py
│       │   ├── contribution.py
│       │   ├── dictionary.py
│       │   └── common.py
│       ├── primitives/
│       |    ├── resources/
│       │    │   ├── article.py
│       │    │   ├── contribution.py
│       │    │   └── dictionary.py
│       |    └── tools/
│       |        ├── article.py
│       |        ├── contribution.py
│       |        └── dictionary.py
│       └── common/
│           ├── utils.py
│           ├── cache.py
│           └── http_session.py
├── examples/
├── tests/
├── pyproject.toml
└── requirements.txt

🦜 Usage

Primitive resources

Resources are asynchronous functions that expose public Data from NTeALan API endpoints for dictionaries, articles, and contributions. They are registered with the MCP server and can be called via their custom URIs.

Example resource registration:

ntl_mcp_server.add_resource_fn(
    lambda dictionary_id, article_id, params: get_article_by_id(
        dictionary_id, article_id, params, ntl_mcp_server.get_context()
    ),
    name="get_article_by_id",
    uri="ntealan-apis://articles/dictionary/{dictionary_id}/{article_id}?{params}",
    tags=["article-endpoint", "mcp-resource"],
    mime_type="application/json",
    description="Get an article by ID"
)

# or just use the classic integration
@ntl_mcp_server.resource(
    uri="ntealan-apis://articles/dictionary/{dictionary_id}/{article_id}?{params}",
    tags=["article-endpoint", "mcp-resource"],
    mime_type="application/json"
)
async def get_article_by_id(
    dictionary_id: str, article_id: UUID,
    params: str, ctx: Context
) -> McpResourceResponse:
    """
    Retrieve a article by its unique identifier.
    """
    # Placeholder logic
    return {"status": "OK", "data": f"Hello, {article_id}!"}

List of existings resources and status:

Name / URI PatternDescriptionParametersDevelopment Status
ntealan-apis://dictionaries/dictionary/{dictionary_id}Get dictionary metadata by IDdictionary_idStable
ntealan-apis://dictionaries?limit=2Get all dictionaries metadatalimitStable
ntealan-apis://dictionaries/statistics/{dictionary_id}Get statistics for a specific dictionarydictionary_idStable
ntealan-apis://dictionaries/statisticsGet statistics for all dictionariesNoneStable
ntealan-apis://articles/dictionary/{dictionary_id}/{article_id}?noneGet article by IDdictionary_id, article_idStable
ntealan-apis://articles?limit=2Get all articleslimitStable
ntealan-apis://articles/dictionary/{dictionary_id}?limit=2Get all articles for a dictionarydictionary_id, limitStable
ntealan-apis://articles/statistics/{dictionary_id}Get article statistics for a dictionarydictionary_idStable
ntealan-apis://articles/statisticsGet statistics for all articlesNoneNot stable
ntealan-apis://contributions/{dictionary_id}/{contribution_id}Get contribution by IDdictionary_id, contribution_idStable
ntealan-apis://greeting/ElvisGreeting resourcenameStable
ntealan-apis://articles/dictionaries/search/{dictionary_id}?q=mba&page=1&limit=1Search articles in a dictionarydictionary_id, q, page, limitStable
ntealan-apis://articles/search?q=mba&page=1Search articlesq, pageStable
ntealan-apis://dictionaries/search?q=yemb&page=1&limit=1Search dictionariesq, page, limitStable

Primitive tools

Tools are utility functions for creating, updating, and deleting dictionaries, articles, and contributions.

Example tool registration:

ntl_mcp_server.add_tool(
    create_dictionary,
    description="Create a new dictionary",
    tags=["mcp-tool", "dictionary-endpoint"]
)

List of existings tools and status (NOT YET IMPLEMENTED):

Tool NameDescriptionRequired Payload FieldsDevelopment Status
create_dictionaryCreate a new dictionarydata (dictionary fields)Not started
update_dictionaryUpdate an existing dictionarydictionary_id, data (fields to update)Not started
delete_dictionaryDelete a dictionarydictionary_idNot started
create_articleCreate a new articledictionary_id, data (article fields)Not started
update_articleUpdate an articledictionary_id, article_id, data (fields to update)Not started
delete_articleDelete an articledictionary_id, article_idNot started
create_contributionCreate a new contributiondictionary_id, article_id, data (contribution fields)Not started
update_contributionUpdate a contributiondictionary_id, article_id, contribution_id, dataNot started
delete_contributionDelete a contributiondictionary_id, article_id, contribution_idNot started

Run examples

Check examples/ folder to run and test some samples.

# for all resources
uv run examples/run_client_resources.py -t sse -e prod -s 8
# for all tools
uv run examples/run_client_tools.py -t stdio -e local -s 0

You can get docs on :

# for all resources
uv run examples/run_client_resources.py -h
# for all tools
uv run examples/run_client_tools.py -h

Deploying with Docker

You can deploy the MCP server using Docker and serve it behind an Nginx reverse proxy for production environments.

1. Build the Docker image

Build the Docker image manually:

docker build -t ntealan-mcp-server .

2. Or automatically build and start the service

  • Get and check the latest version of compose and Docker. You will get in response Docker Compose version v2.35.1.
docker compose version
  • Build and start the service
docker compose up --build -d
  • Your MCP server will now be accessible at this address http://0.0.0.0:8000 or your configured domain.

  • Connect with MCP Client at http://127.0.0.1:8000/sse or your configured domain.

Connect with Smithery

  • Install mcp cli
uv add "mcp[cli]"
  • Connect with MCP client
import mcp
from mcp.client.websocket import websocket_client
import json
import base64

smithery_api_key = "your-api-key"
url = f"wss://server.smithery.ai/@Levis0045/ntealan-apis-mcp-server/ws?api_key={smithery_api_key}"

async def main():
    # Connect to the server using websocket client
    async with websocket_client(url) as streams:
        async with mcp.ClientSession(*streams) as session:
            # Initialize the connection
            await session.initialize()
            # List available tools
            tools_result = await session.list_tools()
            print(f"Available tools: {', '.join([t.name for t in tools_result.tools])}")

            # Example of calling a tool:
            # result = await session.call_tool("tool-name", arguments={"arg1": "value"})

if __name__ == "__main__":
    import asyncio
    asyncio.run(main())

🦜 Contributing

Get more informations in this file: CONTRIBUTION.md

🦜 Contact

Recommend Servers
TraeBuild with Free GPT-4.1 & Claude 3.7. Fully MCP-Ready.
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"
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.
Context7Context7 MCP Server -- Up-to-date code documentation for LLMs and AI code editors
WindsurfThe new purpose-built IDE to harness magic
EdgeOne Pages MCPAn MCP service designed for deploying HTML content to EdgeOne Pages and obtaining an accessible public URL.
Playwright McpPlaywright MCP server
AiimagemultistyleA Model Context Protocol (MCP) server for image generation and manipulation using fal.ai's Stable Diffusion model.
Serper MCP ServerA Serper 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.
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.
Jina AI MCP ToolsA Model Context Protocol (MCP) server that integrates with Jina AI Search Foundation APIs.
MCP AdvisorMCP Advisor & Installation - Use the right MCP server for your needs
CursorThe AI Code Editor
ChatWiseThe second fastest AI chatbot™
Tavily Mcp
DeepChatYour AI Partner on Desktop
MiniMax MCPOfficial MiniMax Model Context Protocol (MCP) server that enables interaction with powerful Text to Speech, image generation and video generation APIs.
Amap Maps高德地图官方 MCP Server
Visual Studio Code - Open Source ("Code - OSS")Visual Studio Code
Baidu Map百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。