本项目是一个基于 Model Context Protocol (MCP) 的服务器,它能让用户通过邮编搜索英国土地注册处的房地产价格,借助 HM 土地注册处的 SPARQL 端点实现数据查询。
本服务器允许用户通过邮编搜索英国土地注册处的房地产价格,使用 HM 土地注册处的 SPARQL 端点。你可以快速安装并使用它来查询相关房地产价格信息。
npm install -g property-prices-mcp
npm install property-prices-mcp
property-prices-mcp
import { McpClient } from '@modelcontextprotocol/sdk/client';
const client = new McpClient();
const result = await client.resource('property-prices').query({
postcode: 'SW1A 1AA',
minPrice: 1000000,
propertyType: 'flat',
limit: 5,
});
console.log(result);
⚠️ 重要提示
英国土地注册处的数据对街道名称和城市名称的大小写是敏感的。但是,此 MCP 会在发送到 land registry API 之前自动将这些参数转换为大写,因此您可以在搜索中使用任意大小写的字符。
示例:
"Cherry Drive" 和 "CHERRY DRIVE" 都会正确工作。
服务器接受以下搜索参数:
参数名称 | 类型 | 描述 | 默认值 |
---|---|---|---|
postcode | string | 英国邮编来搜索 | - |
street | string | 街道名称 | - |
city | string | 城市名称 | - |
minPrice | number | 房地产的最小价格 | - |
maxPrice | number | 房地产的最大价格 | - |
propertyType | string | 一个为:detached, semi-detached, terraced, flat, 或其他类型 | - |
bedrooms | number | 房间数量 | - |
bathrooms | number | 浴室数量 | - |
yearBuilt | number | 建造年份 | - |
dateRange | string | 日期范围(格式:YYYY-MM-DD) | - |
服务器将返回以下 JSON 格式的响应:
{
"properties": {
"price": number,
"bedrooms": number,
"bathrooms": number,
"yearBuilt": number,
"date": string,
"location": string
}
}
如果发生错误,服务器将返回以下 JSON 格式的错误响应:
{
"error": {
"code": number,
"message": string
}
}
可能的错误代码和消息包括:
400
: "无效请求参数"404
: "未找到数据"500
: "服务器内部错误"请阅读 CONTRIBUTING.md 以了解我们的行为准则以及提交拉取请求的过程。
请查看 CHANGELOG.md 以获取变更列表和版本历史记录。
此项目根据 MIT 许可证发布 - 有关详细信息,请参阅 LICENSE 文件。