Content
# QQWry MCP Service
A lightweight service based on the [Model Context Protocol (MCP)](https://modelcontextprotocol.io) that provides geolocation query capabilities for the QQWry IP database.
## Features
- Provides a service interface compliant with the MCP specification, supporting integration with MCP-compatible clients
- Implements parsing and querying of the QQWry IP database (QQWry.dat) based on `lib-qqwry`
- Supports various deployment methods: command line invocation (CLI), HTTP service, etc.
- Supports ES module syntax (type: "module") for Node.js 18+
- Provides standardized input validation (Zod) and error handling
## Tool List
| Tool Name | Description |
|----------------------|-----------------------------------------------------------------------------|
| `query_ip` | Retrieves the location information of an IP address from the QQWry IP database; querying 255.255.255.255 can retrieve the version information of the QQWry IP database |
| `query_ip_scope` | Retrieves the location information of all IP addresses within a specified IP range from the QQWry IP database, returning results in the form of an IP range |
| `get_ip_use_keyword` | Queries all IP ranges that match a specified keyword from the QQWry IP database |
| `change_ip_data_path`| Users can specify the QQWry IP database file to switch to; if no file path is specified, the default QQWry IP database file will be used |
## Usage
### MCP Configuration
```json
{
"mcpServers": {
"qqwry": {
"command": "npx",
"args": [
"-y",
"@cnwhy/qqwry-mcp"
]
}
}
}
```
### Environment Variables
- `QQWRY_DATA_PATH`: Specifies the path to the QQWry IP database file (optional, defaults to the built-in path)
- `PORT`: The port for the web service to listen on (optional, defaults to 3000, effective when using web service mode)
## Test Examples
### Stdio Test
```bash
npm test
```
### HTTP Test
```bash
# First, start the service
npm start
# Then run the test in another terminal
npm run test:http
```
## Tech Stack
- [Node.js](https://nodejs.org/) >=18.0.0
- [Express](https://expressjs.com/) ^5.1.0
- [@modelcontextprotocol/sdk](https://modelcontextprotocol.io) ^1.0.0
- [lib-qqwry](https://github.com/cnwhy/lib-qqwry) ^1.0.0
- [zod](https://zod.dev/) ^3.25.76
## License
MIT
Connection Info
You Might Also Like
markitdown
MarkItDown-MCP is a lightweight server for converting URIs to Markdown.
markitdown
Python tool for converting files and office documents to Markdown.
Filesystem
Node.js MCP Server for filesystem operations with dynamic access control.
OmniRoute
Never stop coding. The free AI gateway — one endpoint, 160+ providers, zero...
TrendRadar
TrendRadar: Your hotspot assistant for real news in just 30 seconds.
mempalace
The highest-scoring AI memory system ever benchmarked. And it's free.