@cenogram/mcp-server 0.1.2 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api-client.d.ts +9 -0
- package/dist/api-client.js +15 -0
- package/dist/mappings.d.ts +4 -0
- package/dist/mappings.js +52 -0
- package/dist/tools.js +31 -1
- package/package.json +2 -2
package/dist/api-client.d.ts
CHANGED
|
@@ -103,6 +103,9 @@ export interface TransactionParams {
|
|
|
103
103
|
parcelId?: string;
|
|
104
104
|
propertyType?: number;
|
|
105
105
|
marketType?: number;
|
|
106
|
+
unitFunction?: number;
|
|
107
|
+
buildingType?: number;
|
|
108
|
+
mpzpDesignation?: string;
|
|
106
109
|
minPrice?: number;
|
|
107
110
|
maxPrice?: number;
|
|
108
111
|
dateFrom?: string;
|
|
@@ -138,6 +141,9 @@ export interface SpatialSearchParams {
|
|
|
138
141
|
};
|
|
139
142
|
propertyType?: number;
|
|
140
143
|
marketType?: number;
|
|
144
|
+
unitFunction?: number;
|
|
145
|
+
buildingType?: number;
|
|
146
|
+
mpzpDesignation?: string;
|
|
141
147
|
minPrice?: number;
|
|
142
148
|
maxPrice?: number;
|
|
143
149
|
dateFrom?: string;
|
|
@@ -192,6 +198,9 @@ export interface CompareParams {
|
|
|
192
198
|
districts: string;
|
|
193
199
|
propertyType?: number;
|
|
194
200
|
marketType?: number;
|
|
201
|
+
unitFunction?: number;
|
|
202
|
+
buildingType?: number;
|
|
203
|
+
mpzpDesignation?: string;
|
|
195
204
|
minPrice?: number;
|
|
196
205
|
maxPrice?: number;
|
|
197
206
|
dateFrom?: string;
|
package/dist/api-client.js
CHANGED
|
@@ -95,6 +95,9 @@ export function getTransactions(p, apiKey) {
|
|
|
95
95
|
parcelId: p.parcelId,
|
|
96
96
|
propertyType: p.propertyType,
|
|
97
97
|
marketType: p.marketType,
|
|
98
|
+
unitFunction: p.unitFunction,
|
|
99
|
+
buildingType: p.buildingType,
|
|
100
|
+
mpzpDesignation: p.mpzpDesignation,
|
|
98
101
|
minPrice: p.minPrice,
|
|
99
102
|
maxPrice: p.maxPrice,
|
|
100
103
|
dateFrom: p.dateFrom,
|
|
@@ -114,6 +117,9 @@ export function getTransactionsSummary(p, apiKey) {
|
|
|
114
117
|
street: p.street,
|
|
115
118
|
propertyType: p.propertyType,
|
|
116
119
|
marketType: p.marketType,
|
|
120
|
+
unitFunction: p.unitFunction,
|
|
121
|
+
buildingType: p.buildingType,
|
|
122
|
+
mpzpDesignation: p.mpzpDesignation,
|
|
117
123
|
minPrice: p.minPrice,
|
|
118
124
|
maxPrice: p.maxPrice,
|
|
119
125
|
dateFrom: p.dateFrom,
|
|
@@ -141,6 +147,12 @@ export function searchByPolygon(p, apiKey) {
|
|
|
141
147
|
body.propertyType = p.propertyType;
|
|
142
148
|
if (p.marketType != null)
|
|
143
149
|
body.marketType = p.marketType;
|
|
150
|
+
if (p.unitFunction != null)
|
|
151
|
+
body.unitFunction = p.unitFunction;
|
|
152
|
+
if (p.buildingType != null)
|
|
153
|
+
body.buildingType = p.buildingType;
|
|
154
|
+
if (p.mpzpDesignation)
|
|
155
|
+
body.mpzpDesignation = p.mpzpDesignation;
|
|
144
156
|
if (p.minPrice != null)
|
|
145
157
|
body.minPrice = p.minPrice;
|
|
146
158
|
if (p.maxPrice != null)
|
|
@@ -166,6 +178,9 @@ export function compareLocations(p, apiKey) {
|
|
|
166
178
|
districts: p.districts,
|
|
167
179
|
propertyType: p.propertyType,
|
|
168
180
|
marketType: p.marketType,
|
|
181
|
+
unitFunction: p.unitFunction,
|
|
182
|
+
buildingType: p.buildingType,
|
|
183
|
+
mpzpDesignation: p.mpzpDesignation,
|
|
169
184
|
minPrice: p.minPrice,
|
|
170
185
|
maxPrice: p.maxPrice,
|
|
171
186
|
dateFrom: p.dateFrom,
|
package/dist/mappings.d.ts
CHANGED
|
@@ -2,6 +2,10 @@ export declare const PROPERTY_TYPES: Record<number, string>;
|
|
|
2
2
|
export declare const MARKET_TYPES: Record<number, string>;
|
|
3
3
|
export declare function mapPropertyType(value: string | undefined): number | undefined;
|
|
4
4
|
export declare function mapMarketType(value: string | undefined): number | undefined;
|
|
5
|
+
export declare const UNIT_FUNCTIONS: Record<number, string>;
|
|
6
|
+
export declare function mapUnitFunction(value: string | undefined): number | undefined;
|
|
7
|
+
export declare const BUILDING_TYPES: Record<number, string>;
|
|
8
|
+
export declare function mapBuildingType(value: string | undefined): number | undefined;
|
|
5
9
|
/** Convert lat/lng/radius to bbox [minLng, minLat, maxLng, maxLat] (lng-first!) */
|
|
6
10
|
export declare function radiusKmToBbox(lat: number, lng: number, radiusKm: number): [number, number, number, number];
|
|
7
11
|
/** Filter districts by location name (case-insensitive includes match) */
|
package/dist/mappings.js
CHANGED
|
@@ -29,6 +29,58 @@ export function mapMarketType(value) {
|
|
|
29
29
|
return undefined;
|
|
30
30
|
return MARKET_TYPE_MAP[value];
|
|
31
31
|
}
|
|
32
|
+
// ── Unit function enum maps ─────────────────────────────────────────
|
|
33
|
+
export const UNIT_FUNCTIONS = {
|
|
34
|
+
1: "Residential (Mieszkalna)",
|
|
35
|
+
2: "Commercial (Handlowo-usługowa)",
|
|
36
|
+
3: "Office (Biurowa)",
|
|
37
|
+
4: "Production (Produkcyjna)",
|
|
38
|
+
5: "Garage (Garaż)",
|
|
39
|
+
6: "Other (Inne)",
|
|
40
|
+
};
|
|
41
|
+
const UNIT_FUNCTION_MAP = {
|
|
42
|
+
residential: 1,
|
|
43
|
+
commercial: 2,
|
|
44
|
+
office: 3,
|
|
45
|
+
production: 4,
|
|
46
|
+
garage: 5,
|
|
47
|
+
other: 6,
|
|
48
|
+
};
|
|
49
|
+
export function mapUnitFunction(value) {
|
|
50
|
+
if (!value)
|
|
51
|
+
return undefined;
|
|
52
|
+
return UNIT_FUNCTION_MAP[value];
|
|
53
|
+
}
|
|
54
|
+
// ── Building type enum maps ─────────────────────────────────────────
|
|
55
|
+
export const BUILDING_TYPES = {
|
|
56
|
+
110: "Residential (Mieszkalny)",
|
|
57
|
+
121: "Commercial (Handlowo-usługowy)",
|
|
58
|
+
122: "Industrial (Przemysłowy)",
|
|
59
|
+
123: "Transport (Transportu i łączności)",
|
|
60
|
+
124: "Office (Biurowy)",
|
|
61
|
+
125: "Warehouse (Zbiorniki/Silosy/Magazyny)",
|
|
62
|
+
126: "Education/Sports (Oświaty i sportu)",
|
|
63
|
+
127: "Farm/Utility (Gospodarczy)",
|
|
64
|
+
128: "Hospital (Szpitale)",
|
|
65
|
+
129: "Other non-residential (Pozostałe niemieszkalne)",
|
|
66
|
+
};
|
|
67
|
+
const BUILDING_TYPE_MAP = {
|
|
68
|
+
residential: 110,
|
|
69
|
+
commercial: 121,
|
|
70
|
+
industrial: 122,
|
|
71
|
+
transport: 123,
|
|
72
|
+
office: 124,
|
|
73
|
+
warehouse: 125,
|
|
74
|
+
education_sports: 126,
|
|
75
|
+
farm_utility: 127,
|
|
76
|
+
hospital: 128,
|
|
77
|
+
other_nonresidential: 129,
|
|
78
|
+
};
|
|
79
|
+
export function mapBuildingType(value) {
|
|
80
|
+
if (!value)
|
|
81
|
+
return undefined;
|
|
82
|
+
return BUILDING_TYPE_MAP[value];
|
|
83
|
+
}
|
|
32
84
|
// ── Bbox conversion ─────────────────────────────────────────────────
|
|
33
85
|
/** Convert lat/lng/radius to bbox [minLng, minLat, maxLng, maxLat] (lng-first!) */
|
|
34
86
|
export function radiusKmToBbox(lat, lng, radiusKm) {
|
package/dist/tools.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { getStats, getTransactions, getPricePerM2, getDistricts, getPriceHistogram, getTransactionsSummary, searchParcels, searchByPolygon, compareLocations, } from "./api-client.js";
|
|
3
3
|
import { formatTransactionList, formatMarketOverview, formatPriceStats, formatHistogram, formatParcelResults, formatSpatialResults, formatCompareResults, } from "./formatters.js";
|
|
4
|
-
import { mapPropertyType, mapMarketType, radiusKmToBbox, filterByLocation, } from "./mappings.js";
|
|
4
|
+
import { mapPropertyType, mapMarketType, mapUnitFunction, mapBuildingType, radiusKmToBbox, filterByLocation, } from "./mappings.js";
|
|
5
5
|
// ── Helpers ─────────────────────────────────────────────────────────
|
|
6
6
|
function textResponse(text) {
|
|
7
7
|
return { content: [{ type: "text", text }] };
|
|
@@ -37,6 +37,12 @@ Example: search for apartments in Mokotów sold in 2024 above 500,000 PLN.`, {
|
|
|
37
37
|
.describe("Property type filter"),
|
|
38
38
|
marketType: z.enum(["primary", "secondary"]).optional()
|
|
39
39
|
.describe("Market type: primary (developer) or secondary (resale)"),
|
|
40
|
+
unitFunction: z.enum(["residential", "commercial", "office", "production", "garage", "other"]).optional()
|
|
41
|
+
.describe("Unit/apartment function filter"),
|
|
42
|
+
buildingType: z.enum(["residential", "commercial", "industrial", "transport", "office", "warehouse", "education_sports", "farm_utility", "hospital", "other_nonresidential"]).optional()
|
|
43
|
+
.describe("Building type filter (PKOB classification)"),
|
|
44
|
+
mpzpDesignation: z.string().optional()
|
|
45
|
+
.describe("MPZP zoning designation filter (exact match, e.g. 'budownictwoMieszkanioweWielorodzinne', 'terenObiektowProdukcyjnychSkladowIMagazynow')"),
|
|
40
46
|
minPrice: z.number().optional().describe("Minimum price in PLN"),
|
|
41
47
|
maxPrice: z.number().optional().describe("Maximum price in PLN"),
|
|
42
48
|
dateFrom: z.string().optional().describe("Start date (YYYY-MM-DD)"),
|
|
@@ -60,6 +66,9 @@ Example: search for apartments in Mokotów sold in 2024 above 500,000 PLN.`, {
|
|
|
60
66
|
district: params.location,
|
|
61
67
|
propertyType: mapPropertyType(params.propertyType),
|
|
62
68
|
marketType: mapMarketType(params.marketType),
|
|
69
|
+
unitFunction: mapUnitFunction(params.unitFunction),
|
|
70
|
+
buildingType: mapBuildingType(params.buildingType),
|
|
71
|
+
mpzpDesignation: params.mpzpDesignation,
|
|
63
72
|
minPrice: params.minPrice,
|
|
64
73
|
maxPrice: params.maxPrice,
|
|
65
74
|
dateFrom: params.dateFrom,
|
|
@@ -120,6 +129,10 @@ Example: find apartment sales within 2km of Warsaw's Palace of Culture (lat 52.2
|
|
|
120
129
|
.describe("Property type filter"),
|
|
121
130
|
marketType: z.enum(["primary", "secondary"]).optional()
|
|
122
131
|
.describe("Market type filter"),
|
|
132
|
+
unitFunction: z.enum(["residential", "commercial", "office", "production", "garage", "other"]).optional()
|
|
133
|
+
.describe("Unit/apartment function filter"),
|
|
134
|
+
buildingType: z.enum(["residential", "commercial", "industrial", "transport", "office", "warehouse", "education_sports", "farm_utility", "hospital", "other_nonresidential"]).optional()
|
|
135
|
+
.describe("Building type filter (PKOB classification)"),
|
|
123
136
|
minPrice: z.number().optional().describe("Minimum price in PLN"),
|
|
124
137
|
maxPrice: z.number().optional().describe("Maximum price in PLN"),
|
|
125
138
|
dateFrom: z.string().optional().describe("Start date (YYYY-MM-DD)"),
|
|
@@ -133,6 +146,8 @@ Example: find apartment sales within 2km of Warsaw's Palace of Culture (lat 52.2
|
|
|
133
146
|
bbox: bbox.join(","),
|
|
134
147
|
propertyType: mapPropertyType(params.propertyType),
|
|
135
148
|
marketType: mapMarketType(params.marketType),
|
|
149
|
+
unitFunction: mapUnitFunction(params.unitFunction),
|
|
150
|
+
buildingType: mapBuildingType(params.buildingType),
|
|
136
151
|
minPrice: params.minPrice,
|
|
137
152
|
maxPrice: params.maxPrice,
|
|
138
153
|
dateFrom: params.dateFrom,
|
|
@@ -213,6 +228,12 @@ Example: {"type":"Polygon","coordinates":[[[21.0,52.2],[21.01,52.2],[21.01,52.21
|
|
|
213
228
|
.describe("Property type filter"),
|
|
214
229
|
marketType: z.enum(["primary", "secondary"]).optional()
|
|
215
230
|
.describe("Market type filter"),
|
|
231
|
+
unitFunction: z.enum(["residential", "commercial", "office", "production", "garage", "other"]).optional()
|
|
232
|
+
.describe("Unit/apartment function filter"),
|
|
233
|
+
buildingType: z.enum(["residential", "commercial", "industrial", "transport", "office", "warehouse", "education_sports", "farm_utility", "hospital", "other_nonresidential"]).optional()
|
|
234
|
+
.describe("Building type filter (PKOB classification)"),
|
|
235
|
+
mpzpDesignation: z.string().optional()
|
|
236
|
+
.describe("MPZP zoning designation filter (exact match)"),
|
|
216
237
|
minPrice: z.number().optional().describe("Minimum price in PLN"),
|
|
217
238
|
maxPrice: z.number().optional().describe("Maximum price in PLN"),
|
|
218
239
|
dateFrom: z.string().optional().describe("Start date (YYYY-MM-DD)"),
|
|
@@ -229,6 +250,9 @@ Example: {"type":"Polygon","coordinates":[[[21.0,52.2],[21.01,52.2],[21.01,52.21
|
|
|
229
250
|
polygon: params.polygon,
|
|
230
251
|
propertyType: mapPropertyType(params.propertyType),
|
|
231
252
|
marketType: mapMarketType(params.marketType),
|
|
253
|
+
unitFunction: mapUnitFunction(params.unitFunction),
|
|
254
|
+
buildingType: mapBuildingType(params.buildingType),
|
|
255
|
+
mpzpDesignation: params.mpzpDesignation,
|
|
232
256
|
minPrice: params.minPrice,
|
|
233
257
|
maxPrice: params.maxPrice,
|
|
234
258
|
dateFrom: params.dateFrom,
|
|
@@ -252,6 +276,10 @@ Example: compare Mokotów, Wola, Ursynów for apartments.`, {
|
|
|
252
276
|
.describe("Property type filter (recommended - API requires at least one filter)"),
|
|
253
277
|
marketType: z.enum(["primary", "secondary"]).optional()
|
|
254
278
|
.describe("Market type filter"),
|
|
279
|
+
unitFunction: z.enum(["residential", "commercial", "office", "production", "garage", "other"]).optional()
|
|
280
|
+
.describe("Unit/apartment function filter"),
|
|
281
|
+
buildingType: z.enum(["residential", "commercial", "industrial", "transport", "office", "warehouse", "education_sports", "farm_utility", "hospital", "other_nonresidential"]).optional()
|
|
282
|
+
.describe("Building type filter (PKOB classification)"),
|
|
255
283
|
minPrice: z.number().optional().describe("Minimum price in PLN"),
|
|
256
284
|
maxPrice: z.number().optional().describe("Maximum price in PLN"),
|
|
257
285
|
dateFrom: z.string().optional().describe("Start date (YYYY-MM-DD)"),
|
|
@@ -265,6 +293,8 @@ Example: compare Mokotów, Wola, Ursynów for apartments.`, {
|
|
|
265
293
|
districts: params.districts,
|
|
266
294
|
propertyType: mapPropertyType(params.propertyType),
|
|
267
295
|
marketType: mapMarketType(params.marketType),
|
|
296
|
+
unitFunction: mapUnitFunction(params.unitFunction),
|
|
297
|
+
buildingType: mapBuildingType(params.buildingType),
|
|
268
298
|
minPrice: params.minPrice,
|
|
269
299
|
maxPrice: params.maxPrice,
|
|
270
300
|
dateFrom: params.dateFrom,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cenogram/mcp-server",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"description": "MCP Server for Polish real estate transaction data (7M+ transactions from RCN)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"@types/node": "^22.0.0",
|
|
24
24
|
"tsx": "^4.19.0",
|
|
25
25
|
"typescript": "^5.6.0",
|
|
26
|
-
"vitest": "^3.0.
|
|
26
|
+
"vitest": "^3.0.4"
|
|
27
27
|
},
|
|
28
28
|
"mcpName": "pl.cenogram/mcp-server",
|
|
29
29
|
"keywords": ["mcp", "real-estate", "poland", "rcn", "nieruchomosci", "property", "transactions"],
|