@thenextgennexus/real-estate-mcp-server 1.0.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/README.md ADDED
@@ -0,0 +1,71 @@
1
+ # Real Estate MCP Server
2
+
3
+ Search properties via Redfin and Google Maps real estate data — powered by [nexgendata](https://apify.com/nexgendata) on Apify.
4
+
5
+ ## Quick Start
6
+
7
+ ### Using npx (recommended)
8
+
9
+ ```bash
10
+ npx @nexgendata/real-estate-mcp-server
11
+ ```
12
+
13
+ ### Install globally
14
+
15
+ ```bash
16
+ npm install -g @nexgendata/real-estate-mcp-server
17
+ ```
18
+
19
+ ## Configure with Claude Desktop
20
+
21
+ Add to your Claude Desktop config (`~/Library/Application Support/Claude/claude_desktop_config.json` on macOS):
22
+
23
+ ```json
24
+ {
25
+ "mcpServers": {
26
+ "real-estate-mcp-server": {
27
+ "command": "npx",
28
+ "args": [
29
+ "-y",
30
+ "@nexgendata/real-estate-mcp-server"
31
+ ],
32
+ "env": {
33
+ "APIFY_TOKEN": "your-apify-token-optional"
34
+ }
35
+ }
36
+ }
37
+ }
38
+ ```
39
+
40
+ ## Configure with Cline
41
+
42
+ Add the same configuration to your Cline MCP settings.
43
+
44
+ ## Available Tools
45
+
46
+ | Tool | Description |
47
+ |------|-------------|
48
+ | `search_redfin_properties` | Search Redfin for property listings |
49
+ | `get_property_details` | Get detailed property information |
50
+ | `search_google_maps_real_estate` | Search Google Maps for real estate agents and offices |
51
+
52
+
53
+ ## Environment Variables
54
+
55
+ | Variable | Required | Description |
56
+ |----------|----------|-------------|
57
+ | `APIFY_TOKEN` | No | Your Apify API token for authenticated access. Without it, the server uses the public endpoint (rate-limited). |
58
+
59
+ ## How It Works
60
+
61
+ This MCP server acts as a local stdio bridge to the [nexgendata Apify MCP endpoint](https://nexgendata--real-estate-mcp-server.apify.actor/mcp). When you call a tool, it forwards the request to Apify and returns the results.
62
+
63
+ ## Links
64
+
65
+ - [Apify Store](https://apify.com/nexgendata/real-estate-mcp-server)
66
+ - [GitHub Repository](https://github.com/TheNextGenNexus/ecommerce-mcp-servers)
67
+ - [nexgendata Blog](https://thenextgennexus.com)
68
+
69
+ ## License
70
+
71
+ MIT
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ export {};
package/dist/index.js ADDED
@@ -0,0 +1,133 @@
1
+ #!/usr/bin/env node
2
+ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
3
+ import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
4
+ import { z } from "zod";
5
+ const APIFY_ENDPOINT = "https://nexgendata--real-estate-mcp-server.apify.actor/mcp";
6
+ const APIFY_TOKEN = process.env.APIFY_TOKEN || "";
7
+ async function callApifyTool(toolName, args) {
8
+ const url = new URL(APIFY_ENDPOINT);
9
+ if (APIFY_TOKEN) {
10
+ url.searchParams.set("token", APIFY_TOKEN);
11
+ }
12
+ const body = {
13
+ jsonrpc: "2.0",
14
+ id: 1,
15
+ method: "tools/call",
16
+ params: {
17
+ name: toolName,
18
+ arguments: args
19
+ }
20
+ };
21
+ const response = await fetch(url.toString(), {
22
+ method: "POST",
23
+ headers: { "Content-Type": "application/json" },
24
+ body: JSON.stringify(body)
25
+ });
26
+ if (!response.ok) {
27
+ const errorText = await response.text();
28
+ throw new Error(`Apify API error (${response.status}): ${errorText}`);
29
+ }
30
+ const data = await response.json();
31
+ if (data.error) {
32
+ throw new Error(`Tool error: ${JSON.stringify(data.error)}`);
33
+ }
34
+ // Extract text content from MCP response
35
+ const result = data.result;
36
+ if (result?.content && Array.isArray(result.content)) {
37
+ return result.content
38
+ .filter((c) => c.type === "text")
39
+ .map((c) => c.text)
40
+ .join("\n");
41
+ }
42
+ return JSON.stringify(data.result, null, 2);
43
+ }
44
+ const server = new McpServer({
45
+ name: "real-estate-mcp-server",
46
+ version: "1.0.0"
47
+ });
48
+ server.registerTool("search_redfin_properties", {
49
+ title: "Search Redfin Properties",
50
+ description: "Search Redfin listings",
51
+ inputSchema: {
52
+ location: z.string().describe('Search location'),
53
+ maxItems: z.number().default(20).describe('Maximum results')
54
+ },
55
+ annotations: {
56
+ readOnlyHint: true,
57
+ destructiveHint: false,
58
+ openWorldHint: true
59
+ }
60
+ }, async (args) => {
61
+ try {
62
+ const result = await callApifyTool("search_redfin_properties", args);
63
+ return {
64
+ content: [{ type: "text", text: result }]
65
+ };
66
+ }
67
+ catch (error) {
68
+ const message = error instanceof Error ? error.message : String(error);
69
+ return {
70
+ content: [{ type: "text", text: `Error: ${message}` }],
71
+ isError: true
72
+ };
73
+ }
74
+ });
75
+ server.registerTool("get_property_details", {
76
+ title: "Get Property Details",
77
+ description: "Get property details",
78
+ inputSchema: {
79
+ url: z.string().describe('Property listing URL')
80
+ },
81
+ annotations: {
82
+ readOnlyHint: true,
83
+ destructiveHint: false,
84
+ openWorldHint: true
85
+ }
86
+ }, async (args) => {
87
+ try {
88
+ const result = await callApifyTool("get_property_details", args);
89
+ return {
90
+ content: [{ type: "text", text: result }]
91
+ };
92
+ }
93
+ catch (error) {
94
+ const message = error instanceof Error ? error.message : String(error);
95
+ return {
96
+ content: [{ type: "text", text: `Error: ${message}` }],
97
+ isError: true
98
+ };
99
+ }
100
+ });
101
+ server.registerTool("search_google_maps_real_estate", {
102
+ title: "Search Google Maps Real Estate",
103
+ description: "Search Google Maps for real estate",
104
+ inputSchema: {
105
+ query: z.string().describe('Search query'),
106
+ maxItems: z.number().default(20).describe('Maximum results')
107
+ },
108
+ annotations: {
109
+ readOnlyHint: true,
110
+ destructiveHint: false,
111
+ openWorldHint: true
112
+ }
113
+ }, async (args) => {
114
+ try {
115
+ const result = await callApifyTool("search_google_maps_real_estate", args);
116
+ return {
117
+ content: [{ type: "text", text: result }]
118
+ };
119
+ }
120
+ catch (error) {
121
+ const message = error instanceof Error ? error.message : String(error);
122
+ return {
123
+ content: [{ type: "text", text: `Error: ${message}` }],
124
+ isError: true
125
+ };
126
+ }
127
+ });
128
+ async function main() {
129
+ const transport = new StdioServerTransport();
130
+ await server.connect(transport);
131
+ console.error("Real Estate MCP Server running on stdio");
132
+ }
133
+ main().catch(console.error);
package/package.json ADDED
@@ -0,0 +1,40 @@
1
+ {
2
+ "name": "@thenextgennexus/real-estate-mcp-server",
3
+ "version": "1.0.0",
4
+ "description": "Search properties via Redfin and Google Maps real estate data",
5
+ "type": "module",
6
+ "bin": {
7
+ "real-estate-mcp-server": "./dist/index.js"
8
+ },
9
+ "scripts": {
10
+ "build": "tsc",
11
+ "start": "node dist/index.js",
12
+ "dev": "tsx src/index.ts"
13
+ },
14
+ "dependencies": {
15
+ "@modelcontextprotocol/sdk": "^1.0.0",
16
+ "zod": "^3.22.0"
17
+ },
18
+ "devDependencies": {
19
+ "typescript": "^5.3.0",
20
+ "tsx": "^4.7.0",
21
+ "@types/node": "^20.11.0"
22
+ },
23
+ "engines": {
24
+ "node": ">=18.0.0"
25
+ },
26
+ "keywords": [
27
+ "mcp",
28
+ "model-context-protocol",
29
+ "ai",
30
+ "apify",
31
+ "nexgendata"
32
+ ],
33
+ "author": "nexgendata",
34
+ "license": "MIT",
35
+ "repository": {
36
+ "type": "git",
37
+ "url": "https://github.com/TheNextGenNexus/ecommerce-mcp-servers"
38
+ },
39
+ "mcpName": "io.github.thenextgennexus/real-estate-mcp-server"
40
+ }
package/smithery.yaml ADDED
@@ -0,0 +1,13 @@
1
+ startCommand:
2
+ type: stdio
3
+ configSchema:
4
+ type: object
5
+ required:
6
+ - apifyToken
7
+ properties:
8
+ apifyToken:
9
+ type: string
10
+ description: Your Apify API token. Get one free at https://apify.com
11
+ commandFunction:
12
+ |-
13
+ (config) => ({{ command: 'npx', args: ['tsx', 'src/index.ts'], env: {{ APIFY_TOKEN: config.apifyToken }} }})
package/src/index.ts ADDED
@@ -0,0 +1,158 @@
1
+ #!/usr/bin/env node
2
+ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
3
+ import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
4
+ import { z } from "zod";
5
+
6
+ const APIFY_ENDPOINT = "https://nexgendata--real-estate-mcp-server.apify.actor/mcp";
7
+ const APIFY_TOKEN = process.env.APIFY_TOKEN || "";
8
+
9
+ async function callApifyTool(toolName: string, args: Record<string, unknown>): Promise<string> {
10
+ const url = new URL(APIFY_ENDPOINT);
11
+ if (APIFY_TOKEN) {
12
+ url.searchParams.set("token", APIFY_TOKEN);
13
+ }
14
+
15
+ const body = {
16
+ jsonrpc: "2.0",
17
+ id: 1,
18
+ method: "tools/call",
19
+ params: {
20
+ name: toolName,
21
+ arguments: args
22
+ }
23
+ };
24
+
25
+ const response = await fetch(url.toString(), {
26
+ method: "POST",
27
+ headers: { "Content-Type": "application/json" },
28
+ body: JSON.stringify(body)
29
+ });
30
+
31
+ if (!response.ok) {
32
+ const errorText = await response.text();
33
+ throw new Error(`Apify API error (${response.status}): ${errorText}`);
34
+ }
35
+
36
+ const data = await response.json();
37
+
38
+ if (data.error) {
39
+ throw new Error(`Tool error: ${JSON.stringify(data.error)}`);
40
+ }
41
+
42
+ // Extract text content from MCP response
43
+ const result = data.result;
44
+ if (result?.content && Array.isArray(result.content)) {
45
+ return result.content
46
+ .filter((c: { type: string }) => c.type === "text")
47
+ .map((c: { text: string }) => c.text)
48
+ .join("\n");
49
+ }
50
+
51
+ return JSON.stringify(data.result, null, 2);
52
+ }
53
+
54
+ const server = new McpServer({
55
+ name: "real-estate-mcp-server",
56
+ version: "1.0.0"
57
+ });
58
+
59
+ server.registerTool(
60
+ "search_redfin_properties",
61
+ {
62
+ title: "Search Redfin Properties",
63
+ description: "Search Redfin listings",
64
+ inputSchema: {
65
+ location: z.string().describe('Search location'),
66
+ maxItems: z.number().default(20).describe('Maximum results')
67
+ },
68
+ annotations: {
69
+ readOnlyHint: true,
70
+ destructiveHint: false,
71
+ openWorldHint: true
72
+ }
73
+ },
74
+ async (args) => {
75
+ try {
76
+ const result = await callApifyTool("search_redfin_properties", args);
77
+ return {
78
+ content: [{ type: "text", text: result }]
79
+ };
80
+ } catch (error) {
81
+ const message = error instanceof Error ? error.message : String(error);
82
+ return {
83
+ content: [{ type: "text", text: `Error: ${message}` }],
84
+ isError: true
85
+ };
86
+ }
87
+ }
88
+ );
89
+
90
+ server.registerTool(
91
+ "get_property_details",
92
+ {
93
+ title: "Get Property Details",
94
+ description: "Get property details",
95
+ inputSchema: {
96
+ url: z.string().describe('Property listing URL')
97
+ },
98
+ annotations: {
99
+ readOnlyHint: true,
100
+ destructiveHint: false,
101
+ openWorldHint: true
102
+ }
103
+ },
104
+ async (args) => {
105
+ try {
106
+ const result = await callApifyTool("get_property_details", args);
107
+ return {
108
+ content: [{ type: "text", text: result }]
109
+ };
110
+ } catch (error) {
111
+ const message = error instanceof Error ? error.message : String(error);
112
+ return {
113
+ content: [{ type: "text", text: `Error: ${message}` }],
114
+ isError: true
115
+ };
116
+ }
117
+ }
118
+ );
119
+
120
+ server.registerTool(
121
+ "search_google_maps_real_estate",
122
+ {
123
+ title: "Search Google Maps Real Estate",
124
+ description: "Search Google Maps for real estate",
125
+ inputSchema: {
126
+ query: z.string().describe('Search query'),
127
+ maxItems: z.number().default(20).describe('Maximum results')
128
+ },
129
+ annotations: {
130
+ readOnlyHint: true,
131
+ destructiveHint: false,
132
+ openWorldHint: true
133
+ }
134
+ },
135
+ async (args) => {
136
+ try {
137
+ const result = await callApifyTool("search_google_maps_real_estate", args);
138
+ return {
139
+ content: [{ type: "text", text: result }]
140
+ };
141
+ } catch (error) {
142
+ const message = error instanceof Error ? error.message : String(error);
143
+ return {
144
+ content: [{ type: "text", text: `Error: ${message}` }],
145
+ isError: true
146
+ };
147
+ }
148
+ }
149
+ );
150
+
151
+
152
+ async function main() {
153
+ const transport = new StdioServerTransport();
154
+ await server.connect(transport);
155
+ console.error("Real Estate MCP Server running on stdio");
156
+ }
157
+
158
+ main().catch(console.error);
package/tsconfig.json ADDED
@@ -0,0 +1,16 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ES2022",
4
+ "module": "ESNext",
5
+ "moduleResolution": "bundler",
6
+ "outDir": "./dist",
7
+ "rootDir": "./src",
8
+ "strict": true,
9
+ "esModuleInterop": true,
10
+ "skipLibCheck": true,
11
+ "declaration": true
12
+ },
13
+ "include": [
14
+ "src/**/*"
15
+ ]
16
+ }