@pipeworx/mcp-rentcast 0.1.0
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/LICENSE +21 -0
- package/README.md +55 -0
- package/package.json +20 -0
- package/server.json +18 -0
- package/src/index.ts +204 -0
- package/tsconfig.json +14 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Pipeworx
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# mcp-rentcast
|
|
2
|
+
|
|
3
|
+
Rentcast MCP — wraps Rentcast API (api.rentcast.io/v1)
|
|
4
|
+
|
|
5
|
+
Part of [Pipeworx](https://pipeworx.io) — an MCP gateway connecting AI agents to 965+ live data sources.
|
|
6
|
+
|
|
7
|
+
## Tools
|
|
8
|
+
|
|
9
|
+
| Tool | Description |
|
|
10
|
+
|------|-------------|
|
|
11
|
+
|
|
12
|
+
## Quick Start
|
|
13
|
+
|
|
14
|
+
Add to your MCP client (Claude Desktop, Cursor, Windsurf, etc.):
|
|
15
|
+
|
|
16
|
+
```json
|
|
17
|
+
{
|
|
18
|
+
"mcpServers": {
|
|
19
|
+
"rentcast": {
|
|
20
|
+
"url": "https://gateway.pipeworx.io/rentcast/mcp"
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
Or connect to the full Pipeworx gateway for access to all 965+ data sources:
|
|
27
|
+
|
|
28
|
+
```json
|
|
29
|
+
{
|
|
30
|
+
"mcpServers": {
|
|
31
|
+
"pipeworx": {
|
|
32
|
+
"url": "https://gateway.pipeworx.io/mcp"
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## Using with ask_pipeworx
|
|
39
|
+
|
|
40
|
+
Instead of calling tools directly, you can ask questions in plain English:
|
|
41
|
+
|
|
42
|
+
```
|
|
43
|
+
ask_pipeworx({ question: "your question about Rentcast data" })
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
The gateway picks the right tool and fills the arguments automatically.
|
|
47
|
+
|
|
48
|
+
## More
|
|
49
|
+
|
|
50
|
+
- [All tools and guides](https://github.com/pipeworx-io/examples)
|
|
51
|
+
- [pipeworx.io](https://pipeworx.io)
|
|
52
|
+
|
|
53
|
+
## License
|
|
54
|
+
|
|
55
|
+
MIT
|
package/package.json
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@pipeworx/mcp-rentcast",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Rentcast MCP — wraps Rentcast API (api.rentcast.io/v1)",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "src/index.ts",
|
|
7
|
+
"types": "src/index.ts",
|
|
8
|
+
"keywords": ["mcp", "mcp-server", "model-context-protocol", "pipeworx", "rentcast"],
|
|
9
|
+
"license": "MIT",
|
|
10
|
+
"repository": {
|
|
11
|
+
"type": "git",
|
|
12
|
+
"url": "https://github.com/pipeworx-io/mcp-rentcast"
|
|
13
|
+
},
|
|
14
|
+
"scripts": {
|
|
15
|
+
"typecheck": "tsc --noEmit"
|
|
16
|
+
},
|
|
17
|
+
"devDependencies": {
|
|
18
|
+
"typescript": "^5.7.0"
|
|
19
|
+
}
|
|
20
|
+
}
|
package/server.json
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json",
|
|
3
|
+
"name": "io.github.pipeworx-io/rentcast",
|
|
4
|
+
"title": "Rentcast",
|
|
5
|
+
"description": "Rentcast MCP — wraps Rentcast API (api.rentcast.io/v1)",
|
|
6
|
+
"version": "0.1.0",
|
|
7
|
+
"websiteUrl": "https://pipeworx.io/packs/rentcast",
|
|
8
|
+
"repository": {
|
|
9
|
+
"url": "https://github.com/pipeworx-io/mcp-rentcast",
|
|
10
|
+
"source": "github"
|
|
11
|
+
},
|
|
12
|
+
"remotes": [
|
|
13
|
+
{
|
|
14
|
+
"type": "streamable-http",
|
|
15
|
+
"url": "https://gateway.pipeworx.io/rentcast/mcp"
|
|
16
|
+
}
|
|
17
|
+
]
|
|
18
|
+
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
interface McpToolDefinition {
|
|
2
|
+
name: string;
|
|
3
|
+
description: string;
|
|
4
|
+
inputSchema: {
|
|
5
|
+
type: 'object';
|
|
6
|
+
properties: Record<string, unknown>;
|
|
7
|
+
required?: string[];
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
interface McpToolExport {
|
|
12
|
+
tools: McpToolDefinition[];
|
|
13
|
+
callTool: (name: string, args: Record<string, unknown>) => Promise<unknown>;
|
|
14
|
+
meter?: { credits: number };
|
|
15
|
+
cost?: Record<string, unknown>;
|
|
16
|
+
provider?: string;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Rentcast MCP — wraps Rentcast API (api.rentcast.io/v1)
|
|
21
|
+
*
|
|
22
|
+
* BYO key: requires an API key from https://www.rentcast.io/
|
|
23
|
+
* Passed via _apiKey parameter.
|
|
24
|
+
*
|
|
25
|
+
* Tools:
|
|
26
|
+
* - get_rent_estimate: get rental price estimate for a property address
|
|
27
|
+
* - get_property: get property details (beds, baths, sqft, year built, etc.)
|
|
28
|
+
*/
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
const BASE = 'https://api.rentcast.io/v1';
|
|
32
|
+
|
|
33
|
+
// ── Helpers ───────────────────────────────────────────────────────────
|
|
34
|
+
|
|
35
|
+
function extractKey(args: Record<string, unknown>): string {
|
|
36
|
+
const key = args._apiKey as string;
|
|
37
|
+
delete args._apiKey;
|
|
38
|
+
if (!key) throw new Error('Rentcast API key required. Get one at https://www.rentcast.io/ and pass via _apiKey.');
|
|
39
|
+
return key;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
async function rentcastGet(apiKey: string, path: string, params: Record<string, string>): Promise<unknown> {
|
|
43
|
+
const url = new URL(`${BASE}${path}`);
|
|
44
|
+
for (const [k, v] of Object.entries(params)) {
|
|
45
|
+
url.searchParams.set(k, v);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
const res = await fetch(url.toString(), {
|
|
49
|
+
headers: {
|
|
50
|
+
'X-Api-Key': apiKey,
|
|
51
|
+
Accept: 'application/json',
|
|
52
|
+
},
|
|
53
|
+
});
|
|
54
|
+
if (!res.ok) {
|
|
55
|
+
const text = await res.text();
|
|
56
|
+
throw new Error(`Rentcast API error (${res.status}): ${text}`);
|
|
57
|
+
}
|
|
58
|
+
return res.json();
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
// ── Tool definitions ──────────────────────────────────────────────────
|
|
62
|
+
|
|
63
|
+
const tools: McpToolExport['tools'] = [
|
|
64
|
+
{
|
|
65
|
+
name: 'get_rent_estimate',
|
|
66
|
+
description:
|
|
67
|
+
'Get a rental price estimate for a US property address. Returns estimated monthly rent, price range, and comparable rental data. Example: "1234 Main St, Austin, TX 78701".',
|
|
68
|
+
inputSchema: {
|
|
69
|
+
type: 'object' as const,
|
|
70
|
+
properties: {
|
|
71
|
+
_apiKey: { type: 'string', description: 'Rentcast API key' },
|
|
72
|
+
address: {
|
|
73
|
+
type: 'string',
|
|
74
|
+
description: 'Full street address with city, state, and ZIP (e.g., "5500 Grand Lake Dr, San Antonio, TX 78244")',
|
|
75
|
+
},
|
|
76
|
+
},
|
|
77
|
+
required: ['_apiKey', 'address'],
|
|
78
|
+
},
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
name: 'get_property',
|
|
82
|
+
description:
|
|
83
|
+
'Get property details for a US address. Returns bedrooms, bathrooms, square footage, lot size, year built, property type, and owner info when available.',
|
|
84
|
+
inputSchema: {
|
|
85
|
+
type: 'object' as const,
|
|
86
|
+
properties: {
|
|
87
|
+
_apiKey: { type: 'string', description: 'Rentcast API key' },
|
|
88
|
+
address: {
|
|
89
|
+
type: 'string',
|
|
90
|
+
description: 'Full street address with city, state, and ZIP (e.g., "123 Oak Ave, Denver, CO 80202")',
|
|
91
|
+
},
|
|
92
|
+
},
|
|
93
|
+
required: ['_apiKey', 'address'],
|
|
94
|
+
},
|
|
95
|
+
},
|
|
96
|
+
];
|
|
97
|
+
|
|
98
|
+
// ── callTool dispatcher ───────────────────────────────────────────────
|
|
99
|
+
|
|
100
|
+
async function callTool(name: string, args: Record<string, unknown>): Promise<unknown> {
|
|
101
|
+
const key = extractKey(args);
|
|
102
|
+
|
|
103
|
+
switch (name) {
|
|
104
|
+
case 'get_rent_estimate':
|
|
105
|
+
return getRentEstimate(key, args.address as string);
|
|
106
|
+
case 'get_property':
|
|
107
|
+
return getProperty(key, args.address as string);
|
|
108
|
+
default:
|
|
109
|
+
throw new Error(`Unknown tool: ${name}`);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
// ── Tool implementations ─────────────────────────────────────────────
|
|
114
|
+
|
|
115
|
+
async function getRentEstimate(apiKey: string, address: string) {
|
|
116
|
+
const data = (await rentcastGet(apiKey, '/avm/rent/long-term', { address })) as {
|
|
117
|
+
price: number;
|
|
118
|
+
priceRangeLow: number;
|
|
119
|
+
priceRangeHigh: number;
|
|
120
|
+
propertyType: string;
|
|
121
|
+
bedrooms: number;
|
|
122
|
+
bathrooms: number;
|
|
123
|
+
squareFootage: number;
|
|
124
|
+
latitude: number;
|
|
125
|
+
longitude: number;
|
|
126
|
+
comparables: Array<{
|
|
127
|
+
formattedAddress: string;
|
|
128
|
+
price: number;
|
|
129
|
+
bedrooms: number;
|
|
130
|
+
bathrooms: number;
|
|
131
|
+
squareFootage: number;
|
|
132
|
+
distance: number;
|
|
133
|
+
}>;
|
|
134
|
+
};
|
|
135
|
+
|
|
136
|
+
return {
|
|
137
|
+
estimated_rent: data.price ?? null,
|
|
138
|
+
price_range_low: data.priceRangeLow ?? null,
|
|
139
|
+
price_range_high: data.priceRangeHigh ?? null,
|
|
140
|
+
property_type: data.propertyType ?? null,
|
|
141
|
+
bedrooms: data.bedrooms ?? null,
|
|
142
|
+
bathrooms: data.bathrooms ?? null,
|
|
143
|
+
square_footage: data.squareFootage ?? null,
|
|
144
|
+
latitude: data.latitude ?? null,
|
|
145
|
+
longitude: data.longitude ?? null,
|
|
146
|
+
comparables_count: (data.comparables ?? []).length,
|
|
147
|
+
comparables: (data.comparables ?? []).slice(0, 10).map((c) => ({
|
|
148
|
+
address: c.formattedAddress ?? null,
|
|
149
|
+
price: c.price ?? null,
|
|
150
|
+
bedrooms: c.bedrooms ?? null,
|
|
151
|
+
bathrooms: c.bathrooms ?? null,
|
|
152
|
+
square_footage: c.squareFootage ?? null,
|
|
153
|
+
distance_miles: c.distance ?? null,
|
|
154
|
+
})),
|
|
155
|
+
};
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
async function getProperty(apiKey: string, address: string) {
|
|
159
|
+
const records = (await rentcastGet(apiKey, '/properties', { address })) as Array<{
|
|
160
|
+
formattedAddress: string;
|
|
161
|
+
addressLine1: string;
|
|
162
|
+
city: string;
|
|
163
|
+
state: string;
|
|
164
|
+
zipCode: string;
|
|
165
|
+
county: string;
|
|
166
|
+
propertyType: string;
|
|
167
|
+
bedrooms: number;
|
|
168
|
+
bathrooms: number;
|
|
169
|
+
squareFootage: number;
|
|
170
|
+
lotSize: number;
|
|
171
|
+
yearBuilt: number;
|
|
172
|
+
lastSaleDate: string;
|
|
173
|
+
lastSalePrice: number;
|
|
174
|
+
ownerOccupied: boolean;
|
|
175
|
+
latitude: number;
|
|
176
|
+
longitude: number;
|
|
177
|
+
}>;
|
|
178
|
+
|
|
179
|
+
if (!records || records.length === 0) {
|
|
180
|
+
throw new Error(`No property found for address: ${address}`);
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
const p = records[0];
|
|
184
|
+
return {
|
|
185
|
+
address: p.formattedAddress ?? null,
|
|
186
|
+
city: p.city ?? null,
|
|
187
|
+
state: p.state ?? null,
|
|
188
|
+
zip: p.zipCode ?? null,
|
|
189
|
+
county: p.county ?? null,
|
|
190
|
+
property_type: p.propertyType ?? null,
|
|
191
|
+
bedrooms: p.bedrooms ?? null,
|
|
192
|
+
bathrooms: p.bathrooms ?? null,
|
|
193
|
+
square_footage: p.squareFootage ?? null,
|
|
194
|
+
lot_size: p.lotSize ?? null,
|
|
195
|
+
year_built: p.yearBuilt ?? null,
|
|
196
|
+
last_sale_date: p.lastSaleDate ?? null,
|
|
197
|
+
last_sale_price: p.lastSalePrice ?? null,
|
|
198
|
+
owner_occupied: p.ownerOccupied ?? null,
|
|
199
|
+
latitude: p.latitude ?? null,
|
|
200
|
+
longitude: p.longitude ?? null,
|
|
201
|
+
};
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
export default { tools, callTool, meter: { credits: 5 } } satisfies McpToolExport;
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2022",
|
|
4
|
+
"module": "ESNext",
|
|
5
|
+
"moduleResolution": "bundler",
|
|
6
|
+
"strict": true,
|
|
7
|
+
"esModuleInterop": true,
|
|
8
|
+
"skipLibCheck": true,
|
|
9
|
+
"outDir": "dist",
|
|
10
|
+
"rootDir": "src",
|
|
11
|
+
"declaration": true
|
|
12
|
+
},
|
|
13
|
+
"include": ["src"]
|
|
14
|
+
}
|