Skip to main content

Official Alkax SDKs and MCP

Use typed SDKs generated from the public Alkax developer API instead of hand-writing HTTP clients. All four packages follow the same release version and use the same scoped project credentials. The backend remains proprietary.

Installation commands require the corresponding public registry release. If a package is not yet listed, start with the HTTP API quickstart.

Before you begin​

Create a Sandbox project credential with the places:read scope using the Developer Platform.

Set the secret in your server or local secret manager as ALKAX_KEY. Do not put it in source control, browser bundles, mobile apps, or logs. The Sandbox and Production API origin is the same; the credential determines the environment.

Install and call the .NET SDK​

Requires .NET 8 or later. Install from NuGet — Alkax.Sdk.

dotnet add package Alkax.Sdk
using Alkax.Sdk.Api;
using Alkax.Sdk.Client;
using Alkax.Sdk.Extensions;
using Microsoft.Extensions.DependencyInjection;

var key = Environment.GetEnvironmentVariable("ALKAX_KEY")
?? throw new InvalidOperationException("Configure ALKAX_KEY.");
var services = new ServiceCollection();
services.AddApi(options =>
options.AddTokens(new ApiKeyToken(key, ClientUtils.ApiKeyHeader.X_Alkax_Key)));
using var provider = services.BuildServiceProvider();

var api = provider.GetRequiredService<IAddressesApi>();
var response = await api.GetAddressesSuggestionsAsync("central market");
if (response.IsOk)
Console.WriteLine(response.Ok()?.Suggestions?.Count);
else
Console.Error.WriteLine(response.StatusCode);

Use cancellation tokens for async requests and inspect the typed response status. The default transport rejects redirects and has a finite timeout.

Install and call the Python SDK​

Requires Python 3.9 or later. Install from PyPI — alkax-sdk.

python -m pip install alkax-sdk
import os
from alkax_sdk import ApiClient, Configuration, AddressesApi
from alkax_sdk.exceptions import ApiException

config = Configuration(api_key={"DeveloperKey": os.environ["ALKAX_KEY"]})
with ApiClient(config) as client:
try:
result = AddressesApi(client).get_addresses_suggestions("central market")
print(len(result.suggestions or []))
except ApiException as exc:
print("Alkax HTTP status:", exc.status)

Use the HTTP-info method variant when you need response headers. Log status and request ID, not raw response bodies.

Install and call the Node.js SDK​

Requires Node.js 20 or later; TypeScript declarations are included. Install from npm — @alkax/sdk.

npm install @alkax/sdk
const { AddressesApi, Configuration, ResponseError } = require("@alkax/sdk");

async function main() {
const key = process.env.ALKAX_KEY;
if (!key) throw new Error("Configure ALKAX_KEY");
const api = new AddressesApi(new Configuration({ apiKey: key }));
try {
const result = await api.getAddressesSuggestions({ q: "central market" });
console.log(result.suggestions?.length);
} catch (error) {
if (error instanceof ResponseError) console.error(error.response.status);
else throw error;
}
}
main().catch(() => {
console.error("Alkax request failed");
process.exitCode = 1;
});

Run the example as server-side CommonJS. TypeScript applications can import the same exported classes. Never use a secret developer key in a public browser bundle.

Configure the local MCP server​

Requires Python 3.11 or later. Install PyPI — alkax-mcp.

python -m venv .venv
source .venv/bin/activate
python -m pip install alkax-mcp
{
"mcpServers": {
"alkax": {
"command": "/absolute/path/to/.venv/bin/alkax-mcp",
"args": []
}
}
}

Use the absolute executable path for your virtual environment (on Windows, use its Scripts directory). Configure your MCP host to inject ALKAX_KEY from its secure environment; do not include a real key in a shared configuration file.

The read-only tools discover and verify digital addresses, retrieve public Address Passports, encode or decode Alkax Grid references, and return Sandbox fixtures. No remote HTTP listener or write tools are enabled. Production credentials are rejected unless the process owner explicitly sets ALKAX_MCP_ALLOW_LIVE=1. Give agents only the scopes they require; API results are untrusted data.

Errors, retries and versioning​

Inspect the HTTP status and machine-readable error code; capture X-Request-Id without logging private payloads. Retry read operations with bounded backoff when appropriate. For supported writes, persist and reuse the same Idempotency-Key only for the same request. Pin an approved SDK version in your application and review breaking changes before upgrading.

See the API reference and Errors and retries for the contract and common failure scenarios.