@mountainpass/addressr-mcp 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 ADDED
@@ -0,0 +1,123 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work.
38
+
39
+ "Derivative Works" shall mean any work, whether in Source or Object
40
+ form, that is based on (or derived from) the Work and for which the
41
+ editorial revisions, annotations, elaborations, or other modifications
42
+ represent, as a whole, an original work of authorship.
43
+
44
+ "Contribution" shall mean any work of authorship, including
45
+ the original version of the Work and any modifications or additions
46
+ to that Work or Derivative Works thereof, that is intentionally
47
+ submitted to the Licensor for inclusion in the Work by the copyright owner
48
+ or by an individual or Legal Entity authorized to submit on behalf of
49
+ the copyright owner.
50
+
51
+ "Contributor" shall mean Licensor and any individual or Legal Entity
52
+ on behalf of whom a Contribution has been received by the Licensor and
53
+ subsequently incorporated within the Work.
54
+
55
+ 2. Grant of Copyright License. Subject to the terms and conditions of
56
+ this License, each Contributor hereby grants to You a perpetual,
57
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
58
+ copyright license to reproduce, prepare Derivative Works of,
59
+ publicly display, publicly perform, sublicense, and distribute the
60
+ Work and such Derivative Works in Source or Object form.
61
+
62
+ 3. Grant of Patent License. Subject to the terms and conditions of
63
+ this License, each Contributor hereby grants to You a perpetual,
64
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
65
+ (except as stated in this section) patent license to make, have made,
66
+ use, offer to sell, sell, import, and otherwise transfer the Work,
67
+ where such license applies only to those patent claims licensable
68
+ by such Contributor that are necessarily infringed by their
69
+ Contribution(s) alone or by combination of their Contribution(s)
70
+ with the Work to which such Contribution(s) was submitted.
71
+
72
+ 4. Redistribution. You may reproduce and distribute copies of the
73
+ Work or Derivative Works thereof in any medium, with or without
74
+ modifications, and in Source or Object form, provided that You
75
+ meet the following conditions:
76
+
77
+ (a) You must give any other recipients of the Work or
78
+ Derivative Works a copy of this License; and
79
+
80
+ (b) You must cause any modified files to carry prominent notices
81
+ stating that You changed the files; and
82
+
83
+ (c) You must retain, in the Source form of any Derivative Works
84
+ that You distribute, all copyright, patent, trademark, and
85
+ attribution notices from the Source form of the Work,
86
+ excluding those notices that do not pertain to any part of
87
+ the Derivative Works; and
88
+
89
+ (d) If the Work includes a "NOTICE" text file as part of its
90
+ distribution, then any Derivative Works that You distribute must
91
+ include a readable copy of the attribution notices contained
92
+ within such NOTICE file, excluding any notices that do not
93
+ pertain to any part of the Derivative Works, in at least one
94
+ of the following places: within a NOTICE text file distributed
95
+ as part of the Derivative Works; within the Source form or
96
+ documentation, if provided along with the Derivative Works; or,
97
+ within a display generated by the Derivative Works, if and
98
+ wherever such third-party notices normally appear.
99
+
100
+ 5. Submission of Contributions.
101
+
102
+ 6. Trademarks. This License does not grant permission to use the trade
103
+ names, trademarks, service marks, or product names of the Licensor.
104
+
105
+ 7. Disclaimer of Warranty.
106
+
107
+ 8. Limitation of Liability.
108
+
109
+ 9. Accepting Warranty or Additional Liability.
110
+
111
+ Copyright 2026 Mountain Pass Pty. Limited
112
+
113
+ Licensed under the Apache License, Version 2.0 (the "License");
114
+ you may not use this file except in compliance with the License.
115
+ You may obtain a copy of the License at
116
+
117
+ http://www.apache.org/licenses/LICENSE-2.0
118
+
119
+ Unless required by applicable law or agreed to in writing, software
120
+ distributed under the License is distributed on an "AS IS" BASIS,
121
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
122
+ See the License for the specific language governing permissions and
123
+ limitations under the License.
package/README.md ADDED
@@ -0,0 +1,104 @@
1
+ # @mountainpass/addressr-mcp
2
+
3
+ MCP (Model Context Protocol) server for Australian address search and validation powered by [Addressr](https://addressr.io).
4
+
5
+ Search, validate, and retrieve detailed Australian address data from the Geocoded National Address File (G-NAF) — directly from your AI assistant.
6
+
7
+ ## Quick Start
8
+
9
+ ### 1. Get an API Key
10
+
11
+ Sign up at [RapidAPI](https://rapidapi.com/addressr-addressr-default/api/addressr) to get your API key.
12
+
13
+ ### 2. Configure Your AI Client
14
+
15
+ #### Claude Desktop
16
+
17
+ Add to `~/Library/Application Support/Claude/claude_desktop_config.json`:
18
+
19
+ ```json
20
+ {
21
+ "mcpServers": {
22
+ "addressr": {
23
+ "command": "npx",
24
+ "args": ["-y", "@mountainpass/addressr-mcp"],
25
+ "env": {
26
+ "RAPIDAPI_KEY": "your-rapidapi-key"
27
+ }
28
+ }
29
+ }
30
+ }
31
+ ```
32
+
33
+ #### Claude Code
34
+
35
+ ```bash
36
+ claude mcp add addressr -- npx -y @mountainpass/addressr-mcp
37
+ ```
38
+
39
+ Set `RAPIDAPI_KEY` in your environment.
40
+
41
+ #### Cursor
42
+
43
+ Add to `.cursor/mcp.json`:
44
+
45
+ ```json
46
+ {
47
+ "mcpServers": {
48
+ "addressr": {
49
+ "command": "npx",
50
+ "args": ["-y", "@mountainpass/addressr-mcp"],
51
+ "env": {
52
+ "RAPIDAPI_KEY": "your-rapidapi-key"
53
+ }
54
+ }
55
+ }
56
+ }
57
+ ```
58
+
59
+ #### VS Code
60
+
61
+ Add to `.vscode/mcp.json`:
62
+
63
+ ```json
64
+ {
65
+ "servers": {
66
+ "addressr": {
67
+ "command": "npx",
68
+ "args": ["-y", "@mountainpass/addressr-mcp"],
69
+ "env": {
70
+ "RAPIDAPI_KEY": "your-rapidapi-key"
71
+ }
72
+ }
73
+ }
74
+ }
75
+ ```
76
+
77
+ ## Available Tools
78
+
79
+ ### search-addresses
80
+
81
+ Search Australian addresses by street, suburb, or postcode. Returns up to 8 results per page with standard address format, relevance score, and property ID (PID).
82
+
83
+ **Parameters:**
84
+ - `q` (required) — Search query, e.g. "1 george st sydney", "2000", "pyrmont nsw"
85
+ - `page` (optional) — Page number for paginated results
86
+
87
+ ### get-address
88
+
89
+ Get full address details by property ID (PID). Returns geocoding (lat/long), structured components (street, suburb, state, postcode, unit/flat), and confidence score.
90
+
91
+ **Parameters:**
92
+ - `addressId` (required) — G-NAF Property ID from search results, e.g. "GANSW710280564"
93
+
94
+ ### health
95
+
96
+ Check API service status. Returns version, timestamp, and health status.
97
+
98
+ ## Data Source
99
+
100
+ Address data is sourced from the [Geocoded National Address File (G-NAF)](https://data.gov.au/dataset/ds-dga-19432f89-dc3a-4ef3-b943-5326ef1dbecc), Australia's authoritative address database maintained by Geoscape Australia.
101
+
102
+ ## License
103
+
104
+ Apache-2.0
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ import '../src/server.mjs';
package/package.json ADDED
@@ -0,0 +1,62 @@
1
+ {
2
+ "name": "@mountainpass/addressr-mcp",
3
+ "version": "0.1.0",
4
+ "description": "MCP server for Australian address search and validation via Addressr",
5
+ "author": {
6
+ "name": "Mountain Pass",
7
+ "url": "https://mountain-pass.com.au"
8
+ },
9
+ "license": "Apache-2.0",
10
+ "type": "module",
11
+ "bin": {
12
+ "addressr-mcp": "./bin/addressr-mcp.mjs"
13
+ },
14
+ "files": [
15
+ "src/",
16
+ "bin/"
17
+ ],
18
+ "engines": {
19
+ "node": ">=18"
20
+ },
21
+ "scripts": {
22
+ "test": "node --test test/server.test.mjs",
23
+ "lint": "eslint .",
24
+ "pre-commit": "lint-staged",
25
+ "push:watch": "bash scripts/push-and-watch.sh"
26
+ },
27
+ "dependencies": {
28
+ "@modelcontextprotocol/sdk": "^1.29.0",
29
+ "zod": "^4.3.0"
30
+ },
31
+ "devDependencies": {
32
+ "@changesets/cli": "^2.29.7",
33
+ "@eslint/js": "^9.39.4",
34
+ "eslint": "^9.39.4",
35
+ "eslint-config-prettier": "^10.1.8",
36
+ "eslint-plugin-prettier": "^5.5.5",
37
+ "globals": "^17.4.0",
38
+ "husky": "^9.1.7",
39
+ "lint-staged": "^16.3.3",
40
+ "prettier": "^3.8.1"
41
+ },
42
+ "lint-staged": {
43
+ "*.{js,mjs}": "eslint --fix",
44
+ "*.{json,css,md}": "prettier --write"
45
+ },
46
+ "publishConfig": {
47
+ "access": "public"
48
+ },
49
+ "repository": {
50
+ "type": "git",
51
+ "url": "git+https://github.com/mountain-pass/addressr-mcp.git"
52
+ },
53
+ "keywords": [
54
+ "mcp",
55
+ "model-context-protocol",
56
+ "addressr",
57
+ "australia",
58
+ "address",
59
+ "geocoding",
60
+ "gnaf"
61
+ ]
62
+ }
package/src/server.mjs ADDED
@@ -0,0 +1,89 @@
1
+ import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
+ import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
3
+ import { z } from 'zod';
4
+
5
+ const API_HOST = process.env.RAPIDAPI_HOST || 'addressr.p.rapidapi.com';
6
+ const API_BASE = `https://${API_HOST}`;
7
+
8
+ async function apiCall(path, key) {
9
+ const response = await fetch(`${API_BASE}${path}`, {
10
+ headers: {
11
+ 'x-rapidapi-key': key,
12
+ 'x-rapidapi-host': API_HOST,
13
+ },
14
+ });
15
+ if (!response.ok) {
16
+ throw new Error(`API error: ${response.status} ${response.statusText}`);
17
+ }
18
+ return response.json();
19
+ }
20
+
21
+ export function createServer() {
22
+ const key = process.env.RAPIDAPI_KEY;
23
+ if (!key) {
24
+ console.error(
25
+ 'RAPIDAPI_KEY environment variable is required. Get one at https://rapidapi.com/addressr-addressr-default/api/addressr',
26
+ );
27
+ process.exit(1);
28
+ }
29
+
30
+ const server = new McpServer({
31
+ name: 'addressr',
32
+ version: '0.1.0',
33
+ });
34
+
35
+ server.tool(
36
+ 'search-addresses',
37
+ 'Search Australian addresses by street, suburb, or postcode. Returns up to 8 results per page with standard address format, relevance score, and property ID (PID). Data sourced from the Geocoded National Address File (G-NAF).',
38
+ {
39
+ q: z
40
+ .string()
41
+ .describe(
42
+ 'Australian address search query (min 3 chars). e.g. "1 george st sydney", "2000", "pyrmont nsw"',
43
+ ),
44
+ page: z
45
+ .number()
46
+ .optional()
47
+ .describe('Page number for paginated results (default: first page)'),
48
+ },
49
+ async ({ q, page }) => {
50
+ const params = new URLSearchParams({ q });
51
+ if (page !== undefined) params.set('page', String(page));
52
+ const data = await apiCall(`/addresses?${params}`, key);
53
+ return { content: [{ type: 'text', text: JSON.stringify(data, null, 2) }] };
54
+ },
55
+ );
56
+
57
+ server.tool(
58
+ 'get-address',
59
+ 'Get full address details by property ID (PID). Returns geocoding (lat/long), structured components (street, suburb, state, postcode, unit/flat), and confidence score. PIDs are obtained from search results.',
60
+ {
61
+ addressId: z
62
+ .string()
63
+ .describe(
64
+ "G-NAF Property ID (PID), e.g. 'GANSW710280564'. Obtained from search results.",
65
+ ),
66
+ },
67
+ async ({ addressId }) => {
68
+ const data = await apiCall(`/addresses/${encodeURIComponent(addressId)}`, key);
69
+ return { content: [{ type: 'text', text: JSON.stringify(data, null, 2) }] };
70
+ },
71
+ );
72
+
73
+ server.tool(
74
+ 'health',
75
+ 'Check API service status. Returns version, timestamp, and health status.',
76
+ {},
77
+ async () => {
78
+ const data = await apiCall('/health', key);
79
+ return { content: [{ type: 'text', text: JSON.stringify(data, null, 2) }] };
80
+ },
81
+ );
82
+
83
+ return server;
84
+ }
85
+
86
+ // Start server when run directly
87
+ const server = createServer();
88
+ const transport = new StdioServerTransport();
89
+ await server.connect(transport);