MCP Server logo

MCP Server

by xuhaoruins

The MCP Server provides a suite of API tools to query information from various sources, including legal documents, Microsoft product licensing, weather data, and Azure pricing. It leverages LlamaIndex, Azure OpenAI, and MongoDB/Cosmos DB for enhanced functionality.

View on GitHub

Last updated: N/A

What is MCP Server?

The MCP Server is a backend application that offers a range of API endpoints for retrieving information from different domains. It functions as an integration point and allows Microsoft Copilot to access legal data, licensing details, weather forecasts, Azure pricing, and utility tools such as Chinese character counting.

How to use MCP Server?

To use the server, first install the necessary prerequisites, including Python 3.12+, MongoDB/Cosmos DB, and Azure OpenAI API access. After cloning the repository and installing dependencies, configure the environment variables in a .env file. Start the server using python mcp-server.py --host 0.0.0.0 --port 8080.

Key features of MCP Server

  • Query Chinese Criminal Law articles and provisions

  • Retrieve Microsoft product licensing information

  • Query GDPR and China's Personal Information Protection Law

  • Get weather alerts and forecasts for US locations

  • Query Azure pricing information using OData filter expressions

  • Count Chinese characters in a text string

  • Uses LlamaIndex for vector search

  • Utilizes Azure OpenAI for embeddings and language model capabilities

Use cases of MCP Server

  • Integrating legal information into AI assistants for legal professionals.

  • Providing licensing information to sales teams and IT administrators.

  • Enabling weather data integration into applications.

  • Allowing users to query Azure pricing information based on specific services.

  • Building a Microsoft Copilot plugin to retrieve combined data from various sources

  • Allowing AI systems to have quick and convenient real-time data access.

FAQ from MCP Server

How do I resolve MongoDB connection issues?

Ensure the MongoDB connection string is correctly formatted and that your cluster supports vector search.

What should I do if I encounter Azure OpenAI API issues?

Verify your API key and endpoint are correct and that the model deployment names match your environment variables.

How can I add a new tool to the MCP Server?

Define a new async function with the @mcp.tool() decorator in mcp-server.py, implement the functionality, add error handling, and restart the server.

What Python version is required?

Python 3.12 or higher is required.

Can I deploy the server using Docker?

Yes, the README provides instructions for building and running the server using Docker.