site-intelligence-mcp 0.1.0__tar.gz

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.
@@ -0,0 +1,16 @@
1
+ # secrets
2
+ .env
3
+ .env.local
4
+
5
+ # python
6
+ __pycache__
7
+ *.pyc
8
+ .venv
9
+ venv
10
+
11
+ # node
12
+ node_modules
13
+ .next
14
+
15
+ # macos
16
+ .DS_Store
@@ -0,0 +1,100 @@
1
+ Metadata-Version: 2.5
2
+ Name: site-intelligence-mcp
3
+ Version: 0.1.0
4
+ Summary: MCP server for ecological and agricultural land suitability scoring from satellite data — site selection for agtech, conservation, environmental consulting and apiculture.
5
+ License: MIT
6
+ Keywords: agriculture,agtech,conservation,geospatial,land-suitability,mcp,model-context-protocol,remote-sensing,satellite,site-selection
7
+ Requires-Python: >=3.10
8
+ Requires-Dist: httpx>=0.27.0
9
+ Requires-Dist: mcp>=2.0.0
10
+ Description-Content-Type: text/markdown
11
+
12
+ # Site Intelligence MCP
13
+
14
+ Score any geographic coordinate for **ecological and agricultural land suitability**, directly from your AI coding agent.
15
+
16
+ Analyses satellite and climate data around a point and returns a weighted suitability score with a per-metric breakdown: vegetation health, water access, precipitation, terrain, cropland proximity, urbanisation pressure, climate, and distance to infrastructure.
17
+
18
+ Built for agtech, precision agriculture, ecological field research, conservation planning, environmental consulting and apiculture.
19
+
20
+ ## Install
21
+
22
+ Requires a key for the [Site Intelligence API](https://rapidapi.com/bayrakdaralper/api/site-intelligence-api) on RapidAPI (free tier available).
23
+
24
+ ### Claude Code
25
+
26
+ ```bash
27
+ claude mcp add site-intelligence \
28
+ --env RAPIDAPI_KEY=your_key_here \
29
+ -- uvx site-intelligence-mcp
30
+ ```
31
+
32
+ ### Claude Desktop / Cursor / Windsurf
33
+
34
+ Add to your MCP config:
35
+
36
+ ```json
37
+ {
38
+ "mcpServers": {
39
+ "site-intelligence": {
40
+ "command": "uvx",
41
+ "args": ["site-intelligence-mcp"],
42
+ "env": {
43
+ "RAPIDAPI_KEY": "your_key_here"
44
+ }
45
+ }
46
+ }
47
+ }
48
+ ```
49
+
50
+ ## Usage
51
+
52
+ Ask your agent in plain language:
53
+
54
+ > How suitable is 38.42, 27.14 for an apiary? Check May specifically.
55
+
56
+ > Compare these three coordinates for a reforestation site and tell me which has the best water access.
57
+
58
+ ## Tool
59
+
60
+ ### `site_score`
61
+
62
+ | Parameter | Type | Default | Notes |
63
+ |---|---|---|---|
64
+ | `lat` | float | required | -90 to 90 |
65
+ | `lon` | float | required | -180 to 180 |
66
+ | `radius_m` | int | `2000` | Analysis radius, 200-5000 |
67
+ | `month` | int | *(none)* | 1-12 for a seasonal view; omit for annual |
68
+ | `detail` | `"summary"` \| `"full"` | `"summary"` | `"full"` adds per-metric raw diagnostics |
69
+
70
+ `detail` defaults to `"summary"` deliberately: tool results are spent from the
71
+ model's context window, and the full diagnostic payload runs to several KB.
72
+ Ask for `"full"` only when you need the underlying values.
73
+
74
+ ### Without `uv`
75
+
76
+ ```bash
77
+ pip install site-intelligence-mcp
78
+ ```
79
+
80
+ then use `site-intelligence-mcp` as the `command` with no `args`.
81
+
82
+ ## Configuration
83
+
84
+ | Variable | Required | Default |
85
+ |---|---|---|
86
+ | `RAPIDAPI_KEY` | yes | — |
87
+ | `BEELOCATE_RAPIDAPI_HOST` | no | `site-intelligence-api.p.rapidapi.com` |
88
+
89
+ Get a key from the [Site Intelligence API listing](https://rapidapi.com/bayrakdaralper/api/site-intelligence-api).
90
+
91
+ ## Limits
92
+
93
+ - Not a weather forecast and not a property-value estimate.
94
+ - Resolution is bounded by the underlying satellite sources; very small radii
95
+ will not resolve individual parcels.
96
+ - Rate limits and quota follow your RapidAPI plan.
97
+
98
+ ## Licence
99
+
100
+ MIT
@@ -0,0 +1,89 @@
1
+ # Site Intelligence MCP
2
+
3
+ Score any geographic coordinate for **ecological and agricultural land suitability**, directly from your AI coding agent.
4
+
5
+ Analyses satellite and climate data around a point and returns a weighted suitability score with a per-metric breakdown: vegetation health, water access, precipitation, terrain, cropland proximity, urbanisation pressure, climate, and distance to infrastructure.
6
+
7
+ Built for agtech, precision agriculture, ecological field research, conservation planning, environmental consulting and apiculture.
8
+
9
+ ## Install
10
+
11
+ Requires a key for the [Site Intelligence API](https://rapidapi.com/bayrakdaralper/api/site-intelligence-api) on RapidAPI (free tier available).
12
+
13
+ ### Claude Code
14
+
15
+ ```bash
16
+ claude mcp add site-intelligence \
17
+ --env RAPIDAPI_KEY=your_key_here \
18
+ -- uvx site-intelligence-mcp
19
+ ```
20
+
21
+ ### Claude Desktop / Cursor / Windsurf
22
+
23
+ Add to your MCP config:
24
+
25
+ ```json
26
+ {
27
+ "mcpServers": {
28
+ "site-intelligence": {
29
+ "command": "uvx",
30
+ "args": ["site-intelligence-mcp"],
31
+ "env": {
32
+ "RAPIDAPI_KEY": "your_key_here"
33
+ }
34
+ }
35
+ }
36
+ }
37
+ ```
38
+
39
+ ## Usage
40
+
41
+ Ask your agent in plain language:
42
+
43
+ > How suitable is 38.42, 27.14 for an apiary? Check May specifically.
44
+
45
+ > Compare these three coordinates for a reforestation site and tell me which has the best water access.
46
+
47
+ ## Tool
48
+
49
+ ### `site_score`
50
+
51
+ | Parameter | Type | Default | Notes |
52
+ |---|---|---|---|
53
+ | `lat` | float | required | -90 to 90 |
54
+ | `lon` | float | required | -180 to 180 |
55
+ | `radius_m` | int | `2000` | Analysis radius, 200-5000 |
56
+ | `month` | int | *(none)* | 1-12 for a seasonal view; omit for annual |
57
+ | `detail` | `"summary"` \| `"full"` | `"summary"` | `"full"` adds per-metric raw diagnostics |
58
+
59
+ `detail` defaults to `"summary"` deliberately: tool results are spent from the
60
+ model's context window, and the full diagnostic payload runs to several KB.
61
+ Ask for `"full"` only when you need the underlying values.
62
+
63
+ ### Without `uv`
64
+
65
+ ```bash
66
+ pip install site-intelligence-mcp
67
+ ```
68
+
69
+ then use `site-intelligence-mcp` as the `command` with no `args`.
70
+
71
+ ## Configuration
72
+
73
+ | Variable | Required | Default |
74
+ |---|---|---|
75
+ | `RAPIDAPI_KEY` | yes | — |
76
+ | `BEELOCATE_RAPIDAPI_HOST` | no | `site-intelligence-api.p.rapidapi.com` |
77
+
78
+ Get a key from the [Site Intelligence API listing](https://rapidapi.com/bayrakdaralper/api/site-intelligence-api).
79
+
80
+ ## Limits
81
+
82
+ - Not a weather forecast and not a property-value estimate.
83
+ - Resolution is bounded by the underlying satellite sources; very small radii
84
+ will not resolve individual parcels.
85
+ - Rate limits and quota follow your RapidAPI plan.
86
+
87
+ ## Licence
88
+
89
+ MIT
@@ -0,0 +1,3 @@
1
+ from .server import main
2
+
3
+ __all__ = ["main"]
@@ -0,0 +1,136 @@
1
+ """MCP server exposing the Site Intelligence API to LLM coding agents.
2
+
3
+ This is a distribution channel, not a new product: it is a thin stdio client
4
+ for the already-deployed RapidAPI listing. Each user supplies their own
5
+ RapidAPI key, so billing, rate limits and quota all stay on rails that
6
+ already exist — this package holds no credentials of its own and reaches no
7
+ service that the RapidAPI listing does not already expose publicly.
8
+ """
9
+ import os
10
+ from importlib.metadata import PackageNotFoundError, version as _pkg_version
11
+ from typing import Any, Literal
12
+
13
+ import httpx
14
+ from mcp.server.mcpserver import MCPServer
15
+
16
+ RAPIDAPI_HOST = os.environ.get(
17
+ "BEELOCATE_RAPIDAPI_HOST", "site-intelligence-api.p.rapidapi.com"
18
+ )
19
+ REQUEST_TIMEOUT_S = 60.0
20
+
21
+ try:
22
+ __version__ = _pkg_version("site-intelligence-mcp")
23
+ except PackageNotFoundError: # running from a source checkout
24
+ __version__ = "0.0.0+dev"
25
+
26
+ mcp = MCPServer(
27
+ name="site-intelligence",
28
+ title="Site Intelligence",
29
+ description=(
30
+ "Score any coordinate for ecological and agricultural land suitability "
31
+ "from satellite and climate data."
32
+ ),
33
+ website_url="https://rapidapi.com/bayrakdaralper/api/site-intelligence-api",
34
+ version=__version__,
35
+ )
36
+
37
+
38
+ def _api_key() -> str:
39
+ key = os.environ.get("RAPIDAPI_KEY", "").strip()
40
+ if not key:
41
+ raise RuntimeError(
42
+ "RAPIDAPI_KEY is not set. Get a key at "
43
+ f"https://rapidapi.com/ and add it to this server's env block."
44
+ )
45
+ return key
46
+
47
+
48
+ def _summarize(payload: dict[str, Any]) -> dict[str, Any]:
49
+ """Compact the full response to the fields an agent reasons over.
50
+
51
+ The raw payload nests per-metric diagnostic sub-objects that can run to
52
+ several KB. Tool results are spent directly from the model's context
53
+ window, so the full response is opt-in via detail="full".
54
+ """
55
+ metrics = []
56
+ for m in payload.get("metrics", []):
57
+ if not isinstance(m, dict):
58
+ continue
59
+ metrics.append(
60
+ {
61
+ "key": m.get("key"),
62
+ "score": m.get("score"),
63
+ "label": m.get("label"),
64
+ }
65
+ )
66
+ return {
67
+ "score": payload.get("score"),
68
+ "location": {
69
+ "lat": payload.get("lat"),
70
+ "lon": payload.get("lon"),
71
+ "radius_m": payload.get("radius_m"),
72
+ },
73
+ "month": payload.get("month"),
74
+ "metrics": metrics,
75
+ }
76
+
77
+
78
+ @mcp.tool()
79
+ async def site_score(
80
+ lat: float,
81
+ lon: float,
82
+ radius_m: int = 2000,
83
+ month: int | None = None,
84
+ detail: Literal["summary", "full"] = "summary",
85
+ ) -> dict[str, Any]:
86
+ """Score a geographic coordinate for ecological and agricultural land suitability.
87
+
88
+ Analyses satellite and climate data for the area around a point and returns a
89
+ weighted suitability score plus per-metric breakdown: vegetation health, water
90
+ access, precipitation, terrain, cropland proximity, urbanisation pressure,
91
+ climate, and distance to infrastructure.
92
+
93
+ Use for site selection and land assessment — agtech, precision agriculture,
94
+ ecological field research, conservation planning, environmental consulting,
95
+ apiculture. Not a weather forecast and not a property-value estimate.
96
+
97
+ Args:
98
+ lat: Latitude, -90 to 90.
99
+ lon: Longitude, -180 to 180.
100
+ radius_m: Analysis radius in metres, 200 to 5000. Defaults to 2000.
101
+ month: Month 1-12 to evaluate seasonally. Omit for an annual view.
102
+ detail: "summary" returns scores only; "full" adds per-metric raw
103
+ diagnostics, which is considerably larger.
104
+ """
105
+ params: dict[str, Any] = {"lat": lat, "lon": lon, "radius_m": radius_m}
106
+ if month is not None:
107
+ params["month"] = month
108
+
109
+ async with httpx.AsyncClient(timeout=REQUEST_TIMEOUT_S) as client:
110
+ response = await client.get(
111
+ f"https://{RAPIDAPI_HOST}/v1/site-score",
112
+ params=params,
113
+ headers={
114
+ "X-RapidAPI-Key": _api_key(),
115
+ "X-RapidAPI-Host": RAPIDAPI_HOST,
116
+ },
117
+ )
118
+
119
+ if response.status_code == 429:
120
+ raise RuntimeError(
121
+ "Rate limit or quota reached. Check your RapidAPI plan, or retry later."
122
+ )
123
+ if response.status_code in (401, 403):
124
+ raise RuntimeError("RapidAPI rejected the key. Verify RAPIDAPI_KEY and your subscription.")
125
+ response.raise_for_status()
126
+
127
+ payload = response.json()
128
+ return payload if detail == "full" else _summarize(payload)
129
+
130
+
131
+ def main() -> None:
132
+ mcp.run()
133
+
134
+
135
+ if __name__ == "__main__":
136
+ main()
@@ -0,0 +1,33 @@
1
+ [build-system]
2
+ requires = ["hatchling"]
3
+ build-backend = "hatchling.build"
4
+
5
+ [project]
6
+ name = "site-intelligence-mcp"
7
+ version = "0.1.0"
8
+ description = "MCP server for ecological and agricultural land suitability scoring from satellite data — site selection for agtech, conservation, environmental consulting and apiculture."
9
+ readme = "README.md"
10
+ requires-python = ">=3.10"
11
+ license = { text = "MIT" }
12
+ keywords = [
13
+ "mcp",
14
+ "model-context-protocol",
15
+ "geospatial",
16
+ "satellite",
17
+ "land-suitability",
18
+ "site-selection",
19
+ "agriculture",
20
+ "agtech",
21
+ "conservation",
22
+ "remote-sensing",
23
+ ]
24
+ dependencies = [
25
+ "mcp>=2.0.0",
26
+ "httpx>=0.27.0",
27
+ ]
28
+
29
+ [project.scripts]
30
+ site-intelligence-mcp = "beelocate_mcp.server:main"
31
+
32
+ [tool.hatch.build.targets.wheel]
33
+ packages = ["beelocate_mcp"]