Mhlabs MCP Tools
M

Mhlabs MCP Tools

2 points
6.6K

Installation

Copy the following command to your Client for configuration
Note: Your key is sensitive information, do not share it with anyone.

๐Ÿš€ mhlabs-mcp-tools

mhlabs-mcp-tools is a Modular MCP Tools Server built using FastMCP. It offers an extendable AI tool ecosystem categorized by functions (Text Preprocessing, NLP Components, Document Analysis, etc.). These tools can be dynamically loaded and served via MCP (Model Context Protocol) through STDIO transport.

This project is part of the MHLabs AI Agentic Ecosystem and is designed to work with mhlabs-mcp-server, mhlabs-mcp-agents, and downstream A2A agent frameworks.

๐Ÿš€ Quick Start

Development Setup

  1. Clone and Navigate:
    cd src/mhlabs_mcp_tools
    
  2. Install Dependencies:
    pip install -r requirements.txt
    
  3. Configure Environment:
    cp .env.example .env
    # Edit .env with your configuration
    
  4. Start the Server:
    # Default STDIO transport (for local MCP clients)
    python mcp_server.py
    
    # HTTP transport (for web-based clients)
    python mcp_server.py --transport http --port 9000
    or
    after installed mhlabs-mcp-tools
    python -m mhlabs_mcp_tools.mcp_server --transport http --port 9000
    
    # Using FastMCP CLI (recommended)
    fastmcp run mcp_server.py -t streamable-http --port 9000 -l DEBUG
    
    # Debug mode with authentication disabled
    python mcp_server.py --transport http --debug --no-auth
    

Transport Options

1. STDIO Transport (default)

  • ๐Ÿ”ง Ideal for: Local tools, command-line integrations, Claude Desktop
  • ๐Ÿš€ Usage: python mcp_server.py or python mcp_server.py --transport stdio

2. HTTP (Streamable) Transport

  • ๐ŸŒ Ideal for: Web-based deployments, microservices, remote access
  • ๐Ÿš€ Usage: python mcp_server.py --transport http --port 9000
  • ๐ŸŒ URL: http://127.0.0.1:9000/mcp/

3. SSE Transport (deprecated)

  • โš ๏ธ Only for legacy support - use HTTP transport for new projects
  • ๐Ÿš€ Usage: python mcp_server.py --transport sse --port 9000

FastMCP CLI Usage

# Standard HTTP server
fastmcp run mcp_server.py -t streamable-http --port 9000 -l DEBUG

# With custom host
fastmcp run mcp_server.py -t streamable-http --host 0.0.0.0 --port 9000 -l DEBUG

# STDIO transport (for local clients)
fastmcp run mcp_server.py -t stdio

# Development mode with MCP Inspector
fastmcp dev mcp_server.py -t streamable-http --port 9000

VS Code Development

  1. Open in VS Code:
    code .
    
  2. Use Debug Configurations:
    • Debug MCP Server (STDIO): Run with STDIO transport
    • Debug MCP Server (HTTP): Run with HTTP transport
    • Debug Tests: Run the test suite

โœจ Features

  • FastMCP Server: A pure FastMCP implementation that supports multiple transport protocols.
  • Factory Pattern: A reusable MCP tools factory for easy service management.
  • Domain-Based Organization: Services are organized by business domains (HR, Tech Support, etc.).
  • Authentication: Optional Azure AD authentication support.
  • Multiple Transports: Supports STDIO, HTTP (Streamable), and SSE transports.
  • VS Code Integration: Comes with debug configurations and development settings.
  • Comprehensive Testing: Unit tests using pytest.
  • Flexible Configuration: Environment-based configuration management.

๐Ÿ”ง Technical Details

Architecture

mhlabs_mcp_tools/
โ”œโ”€โ”€ .gitignore
โ”œโ”€โ”€ .vscode/
โ”‚   โ””โ”€โ”€ settings.json
โ”œโ”€โ”€ CHANGELOG.md
โ”œโ”€โ”€ LICENSE
โ”œโ”€โ”€ README.md
โ”œโ”€โ”€ docs/
โ”‚   โ””โ”€โ”€ index.md
โ”œโ”€โ”€ examples/
โ”‚   โ”œโ”€โ”€ example_client.py
โ”‚   โ””โ”€โ”€ example_client_http.py
โ”œโ”€โ”€ mkdocs.yml
โ”œโ”€โ”€ pyproject.toml
โ”œโ”€โ”€ requirements.txt
โ”œโ”€โ”€ server.json
โ””โ”€โ”€ src/
    โ”œโ”€โ”€ __init__.py
    โ”œโ”€โ”€ main.py
    โ””โ”€โ”€ mhlabs_mcp_tools/
        โ”œโ”€โ”€ __init__.py
        โ”œโ”€โ”€ core/
        โ”‚   โ”œโ”€โ”€ __init__.py
        โ”‚   โ”œโ”€โ”€ config.py
        โ”‚   โ”œโ”€โ”€ constants.py
        โ”‚   โ”œโ”€โ”€ factory.py
        โ”‚   โ””โ”€โ”€ prompts.py
        โ”œโ”€โ”€ data/
        โ”‚   โ”œโ”€โ”€ __init__.py
        โ”‚   โ”œโ”€โ”€ external/
        โ”‚   โ”‚   โ””โ”€โ”€ __init__.py
        โ”‚   โ”œโ”€โ”€ interim/
        โ”‚   โ”‚   โ””โ”€โ”€ __init__.py
        โ”‚   โ”œโ”€โ”€ processed/
        โ”‚   โ”‚   โ””โ”€โ”€ __init__.py
        โ”‚   โ””โ”€โ”€ raw/
        โ”‚       โ”œโ”€โ”€ __init__.py
        โ”‚       โ”œโ”€โ”€ contractions_dict.json
        โ”‚       โ”œโ”€โ”€ custom_substitutions.csv
        โ”‚       โ”œโ”€โ”€ leftovers_dict.json
        โ”‚       โ””โ”€โ”€ slang_dict.json
        โ”œโ”€โ”€ handlers/
        โ”‚   โ”œโ”€โ”€ __init__.py
        โ”‚   โ”œโ”€โ”€ custom_exceptions.py
        โ”‚   โ””โ”€โ”€ output_generator.py
        โ”œโ”€โ”€ mcp_server.py
        โ”œโ”€โ”€ models/
        โ”‚   โ””โ”€โ”€ __init__.py
        โ”œโ”€โ”€ nlp_components/
        โ”‚   โ”œโ”€โ”€ __init__.py
        โ”‚   โ””โ”€โ”€ nlp_model.py
        โ”œโ”€โ”€ services/
        โ”‚   โ”œโ”€โ”€ __init__.py
        โ”‚   โ”œโ”€โ”€ langchain_framework.py
        โ”‚   โ””โ”€โ”€ spacy_extractor.py
        โ””โ”€โ”€ text_preprocessing/
            โ”œโ”€โ”€ __init__.py
            โ”œโ”€โ”€ contractions.py
            โ”œโ”€โ”€ emo_unicode.py
            โ”œโ”€โ”€ slang_text.py
            โ””โ”€โ”€ text_preprocessing.py

๐Ÿ’ป Usage Examples

Available Services

Currently, the package is organized into three primary modules:

1. NLP Components

Component Type Description
tokenize Text tokenization
pos Part-of-Speech tagging
lemma Word lemmatization
morphology Study of word forms
dep Dependency parsing
ner Named Entity Recognition
norm Text normalization

2. Text Preprocessing

This module provides users with a wide range of text preprocessing tools:

Function Description
to_lower Convert text to lowercase
to_upper Convert text to uppercase
remove_number Remove numerical characters
remove_itemized_bullet_and_numbering Eliminate itemized/bullet-point numbering
remove_url Remove URLs from text
remove_punctuation Remove punctuation marks
remove_special_character Remove special characters
keep_alpha_numeric Keep only alphanumeric characters
remove_whitespace Remove excess whitespace
normalize_unicode Normalize Unicode characters
remove_stopword Eliminate common stopwords
remove_freqwords Remove frequently occurring words
remove_rarewords Remove rare words
remove_email Remove email addresses
remove_phone_number Remove phone numbers
remove_ssn Remove Social Security Numbers (SSN)
remove_credit_card_number Remove credit card numbers
remove_emoji Remove emojis
remove_emoticons Remove emoticons
convert_emoticons_to_words Convert emoticons to words
convert_emojis_to_words Convert emojis to words
remove_html Remove HTML tags
chat_words_conversion Convert chat language to standard English
expand_contraction Expand contractions (e.g., "can't" to "cannot")
tokenize_word Tokenize words
tokenize_sentence Tokenize sentences
stem_word Stem words
lemmatize_word Lemmatize words
preprocess_text Combine multiple preprocessing steps into one function

MCP Client Usage

Python Client

import asyncio
from fastmcp import Client

client = Client("http://localhost:9000/mcp")

async def main():
    async with client:
        tools = await client.list_tools()
        # tools -> list[mcp.types.Tool]
        # print(tools)
        for tool in tools:
            print(f"Tool: {tool.name}")
        
        result = await client.call_tool("textprep.expand_contraction", {"input_text": "The must've SSN is 859-98-0987. The employee's phone number is 555-555-5555."})
        print("Result:", result)

asyncio.run(main())

Command Line Testing

# Test the server is running
curl http://localhost:9000/mcp/

# With FastMCP CLI for testing
fastmcp dev mcp_server.py -t streamable-http --port 9000

Quick Test

Test STDIO Transport:

# Start server in STDIO mode
python mcp_server.py --debug --no-auth

# Test with client_example.py
python client_example.py

Test HTTP Transport:

# Start HTTP server
python mcp_server.py --transport http --port 9000 --debug --no-auth

# Test with FastMCP client
python -c "
from fastmcp import Client
import asyncio
async def test():
    async with Client('http://localhost:9000/mcp') as client:
        result = await client.call_tool("textprep.expand_contraction", {"input_text": "The must've SSN is 859-98-0987. The employee's phone number is 555-555-5555."})
        print(result)
asyncio.run(test())
"

๐Ÿ“š Documentation

Configuration

Environment Variables

Create a .env file based on .env.example:

# Server Settings
MCP_HOST=0.0.0.0
MCP_PORT=9000
MCP_DEBUG=false
MCP_SERVER_NAME=MHLABS MCP Server

# Authentication Settings
MCP_ENABLE_AUTH=true
AZURE_TENANT_ID=your-tenant-id-here
AZURE_CLIENT_ID=your-client-id-here
AZURE_JWKS_URI=https://login.microsoftonline.com/your-tenant-id/discovery/v2.0/keys
AZURE_ISSUER=https://sts.windows.net/your-tenant-id/
AZURE_AUDIENCE=api://your-client-id

Authentication

When MCP_ENABLE_AUTH=true, the server expects Azure AD Bearer tokens. Configure your Azure App Registration with the appropriate settings. For development, set MCP_ENABLE_AUTH=false to disable authentication.

Adding New Services

  1. Create Service Class:
    from core.factory import MCPToolBase, Domain
    
    class MyService(MCPToolBase):
        def __init__(self):
            super().__init__(Domain.MY_DOMAIN)
    
        def register_tools(self, mcp):
            @mcp.tool(tags={self.domain.value})
            async def my_tool(param: str) -> str:
                # Tool implementation
                pass
    
        @property
        def tool_count(self) -> int:
            return 1  # Number of tools
    
  2. Register in Server:
    # In mcp_server.py (gets registered automatically from services/ directory)
    factory.register_service(MyService())
    
  3. Add Domain (if new):
    # In core/factory.py
    class Domain(Enum):
        # ... existing domains
        MY_DOMAIN = "my_domain"
    

Server Arguments

usage: mcp_server.py [-h] [--transport {stdio,http,streamable-http,sse}]
                     [--host HOST] [--port PORT] [--debug] [--no-auth]

MHLABS MCP Server

options:
  -h, --help            show this help message and exit
  --transport, -t       Transport protocol (default: stdio)
  --host HOST           Host to bind to for HTTP transport (default: 127.0.0.1)
  --port, -p PORT       Port to bind to for HTTP transport (default: 9000)
  --debug               Enable debug mode
  --no-auth             Disable authentication

๐Ÿ“„ License

MIT License ยฉ 2025 MusaddiqueHussain Labs

๐Ÿค Contributing

  1. Follow the existing code structure and patterns.
  2. Add tests for new functionality.
  3. Update documentation for new features.
  4. Use the provided VS Code configurations for development.

๐Ÿง  Learn More

๐Ÿ’ก Usage Tip

If you want to embed mhlabs-mcp-tools into a larger MCP-based orchestrator:

from fastmcp import StdioServerParameters
server_params = StdioServerParameters(
    command="python",
    args=["-m", "mhlabs_mcp_tools.server"],
    //env={"MHLABS_MCP_CATEGORY": "textprep,nlp"}
)

Developed with โค๏ธ by MusaddiqueHussain Labs

Alternatives

R
Rsdoctor
Rsdoctor is a build analysis tool specifically designed for the Rspack ecosystem, fully compatible with webpack. It provides visual build analysis, multi - dimensional performance diagnosis, and intelligent optimization suggestions to help developers improve build efficiency and engineering quality.
TypeScript
8.7K
5 points
N
Next Devtools MCP
The Next.js development tools MCP server provides Next.js development tools and utilities for AI programming assistants such as Claude and Cursor, including runtime diagnostics, development automation, and document access functions.
TypeScript
8.7K
5 points
T
Testkube
Testkube is a test orchestration and execution framework for cloud-native applications, providing a unified platform to define, run, and analyze tests. It supports existing testing tools and Kubernetes infrastructure.
Go
7.0K
5 points
M
MCP Windbg
An MCP server that integrates AI models with WinDbg/CDB for analyzing Windows crash dump files and remote debugging, supporting natural language interaction to execute debugging commands.
Python
9.3K
5 points
R
Runno
Runno is a collection of JavaScript toolkits for securely running code in multiple programming languages in environments such as browsers and Node.js. It achieves sandboxed execution through WebAssembly and WASI, supports languages such as Python, Ruby, JavaScript, SQLite, C/C++, and provides integration methods such as web components and MCP servers.
TypeScript
9.9K
5 points
P
Praisonai
PraisonAI is a production-ready multi-AI agent framework with self-reflection capabilities, designed to create AI agents to automate the solution of various problems from simple tasks to complex challenges. It simplifies the construction and management of multi-agent LLM systems by integrating PraisonAI agents, AG2, and CrewAI into a low-code solution, emphasizing simplicity, customization, and effective human-machine collaboration.
Python
9.6K
5 points
N
Netdata
Netdata is an open-source real-time infrastructure monitoring platform that provides second-level metric collection, visualization, machine learning-driven anomaly detection, and automated alerts. It can achieve full-stack monitoring without complex configuration.
Go
9.7K
5 points
M
MCP Server
The Mapbox MCP Server is a model context protocol server implemented in Node.js, providing AI applications with access to Mapbox geospatial APIs, including functions such as geocoding, point - of - interest search, route planning, isochrone analysis, and static map generation.
TypeScript
9.5K
4 points
N
Notion Api MCP
Certified
A Python-based MCP Server that provides advanced to-do list management and content organization functions through the Notion API, enabling seamless integration between AI models and Notion.
Python
19.9K
4.5 points
M
Markdownify MCP
Markdownify is a multi-functional file conversion service that supports converting multiple formats such as PDFs, images, audio, and web page content into Markdown format.
TypeScript
33.8K
5 points
G
Gitlab MCP Server
Certified
The GitLab MCP server is a project based on the Model Context Protocol that provides a comprehensive toolset for interacting with GitLab accounts, including code review, merge request management, CI/CD configuration, and other functions.
TypeScript
23.6K
4.3 points
D
Duckduckgo MCP Server
Certified
The DuckDuckGo Search MCP Server provides web search and content scraping services for LLMs such as Claude.
Python
68.3K
4.3 points
U
Unity
Certified
UnityMCP is a Unity editor plugin that implements the Model Context Protocol (MCP), providing seamless integration between Unity and AI assistants, including real - time state monitoring, remote command execution, and log functions.
C#
31.2K
5 points
F
Figma Context MCP
Framelink Figma MCP Server is a server that provides access to Figma design data for AI programming tools (such as Cursor). By simplifying the Figma API response, it helps AI more accurately achieve one - click conversion from design to code.
TypeScript
62.4K
4.5 points
G
Gmail MCP Server
A Gmail automatic authentication MCP server designed for Claude Desktop, supporting Gmail management through natural language interaction, including complete functions such as sending emails, label management, and batch operations.
TypeScript
20.8K
4.5 points
M
Minimax MCP Server
The MiniMax Model Context Protocol (MCP) is an official server that supports interaction with powerful text-to-speech, video/image generation APIs, and is suitable for various client tools such as Claude Desktop and Cursor.
Python
44.7K
4.8 points