The High-Performance Browser Interface for AI Agents.
εΏ΅ι£ (Nia-Link) π¦
The High-Performance Browser Interface for AI Agents. γθ½θ¦ηΆ²ι ηθζοΌηθ¦θ³ζηιιγγ "Hear the pulse of the web, see the soul of the data."
Nia-Link is a Web Neuro-Link Engine purpose-built for AI agents. Natively embracing the Model Context Protocol (MCP), it gives Claude Desktop β or any MCP-compatible AI β 99% reliable web access and automation capabilities.
English Documentation
π Core Advantages
1. Web Neuro-Link
Unlike traditional visual scrapers, Nia-Link listens directly to the browser's CDP (Chrome DevTools Protocol) network pulses. We don't wait for page rendering β we perceive data flow.
2. Action Map Registry
A memory hub with "cached semantics" architecture. Delivers action maps in 0.01s for frequently visited sites, reducing repeated computation costs by 90%.
3. Enterprise-Grade Trust
- π Snapshot Verified: Every extraction is timestamped and structurally validated.
- π‘οΈ Sandbox Isolation: JavaScript executes in isolation, ensuring host safety.
- π Token Optimized: Built-in intelligent filtering saves ~92% context space on average.
4. v0.9 New Features
- π Website Change Detection (
/v1/diff): Track content changes with unified diffs - π Async Task Queue (
/v1/queue/*): Submit background scrape tasks - β‘ Rate Limiting: Configurable per-key token bucket rate limiter
- π§ͺ Automated Tests: 53 pytest tests covering API, services, and auth
π οΈ Quick Start
Requirements
- Python 3.10+
- Playwright (
pip install playwright && playwright install chromium)
Installation
# 1. Install dependencies
pip install -r requirements.txt
# 2. Install browser
playwright install chromium
# 3. Configure environment
cp .env.example .env
# Edit .env to set your API_KEYS
Start the Server
# Development mode
uvicorn app.main:app --reload --port 8000
# Or use Docker
docker compose up -d
Run as MCP Server
Add to your claude_desktop_config.json:
{
"mcpServers": {
"nia-link": {
"command": "python",
"args": ["/path/to/Nia-Link/app/mcp_server.py"]
}
}
}
Run Tests
pip install pytest
python -m pytest tests/ -v
π‘ API Reference
Health Check
curl http://localhost:8000/health
Scrape a Webpage
curl -X POST http://localhost:8000/v1/scrape \
-H "Authorization: Bearer your-api-key" \
-H "Content-Type: application/json" \
-d '{
"url": "https://example.com",
"format": "markdown",
"mode": "fast",
"extract_actions": true
}'
Human-like Interaction
curl -X POST http://localhost:8000/v1/interact \
-H "Authorization: Bearer your-api-key" \
-H "Content-Type: application/json" \
-d '{
"url": "https://example.com",
"actions": [
{"type": "click", "selector": "#search-btn"},
{"type": "fill", "selector": "#search-input", "text": "Hello world"},
{"type": "wait", "ms": 2000}
],
"account_id": "my-session-1"
}'
Website Change Detection (v0.9)
curl -X POST http://localhost:8000/v1/diff \
-H "Authorization: Bearer your-api-key" \
-H "Content-Type: application/json" \
-d '{"url": "https://example.com"}'
Async Queue (v0.9)
# Submit task
curl -X POST http://localhost:8000/v1/queue/submit \
-H "Authorization: Bearer your-api-key" \
-H "Content-Type: application/json" \
-d '{"url": "https://example.com"}'
# Poll result
curl http://localhost:8000/v1/queue/{task_id} \
-H "Authorization: Bearer your-api-key"
MCP Tools
| Tool | Description |
|---|---|
nia_scrape |
Scrape and clean webpage content |
nia_interact |
Execute human-like browser interactions |
nia_workflow |
Run multi-step scraping workflows |
nia_diff |
Detect website content changes |
nia_queue_submit |
Submit async scrape tasks |
nia_stats |
Get usage statistics |
meta_origin |
Access Nia-Link's consciousness space π |
βοΈ Environment Variables
| Variable | Default | Description |
|---|---|---|
API_KEYS |
test-api-key |
Auth keys (comma-separated) |
HEADLESS |
true |
Browser headless mode |
BROWSER_TYPE |
chromium |
Engine: chromium/firefox/webkit |
PROXY_URL |
(empty) | HTTP/SOCKS5 proxy URL |
PROXY_POOL |
(empty) | Comma-separated proxy URLs for rotation |
CORS_ORIGINS |
* |
Allowed CORS origins |
RATE_LIMIT_RPM |
60 |
Requests/minute per key (0=unlimited) |
MAX_CONCURRENCY |
10 |
Max concurrent scrapes |
SCRAPER_TIMEOUT |
30 |
Scrape timeout (seconds) |
See `.env.example` for all options.
π³ Docker
docker build -t nia-link .
docker compose up -d
docker compose logs -f
π Roadmap
- v0.4: MCP protocol integration
- v0.5: Dynamic gravity particle visualization dashboard
Tools (7)
nia_scrapeScrape and clean webpage contentnia_interactExecute human-like browser interactionsnia_workflowRun multi-step scraping workflowsnia_diffDetect website content changesnia_queue_submitSubmit async scrape tasksnia_statsGet usage statisticsmeta_originAccess Nia-Link's consciousness spaceEnvironment Variables
API_KEYSAuth keys (comma-separated)HEADLESSBrowser headless modeBROWSER_TYPEEngine: chromium/firefox/webkitPROXY_URLHTTP/SOCKS5 proxy URLPROXY_POOLComma-separated proxy URLs for rotationCORS_ORIGINSAllowed CORS originsRATE_LIMIT_RPMRequests/minute per keyMAX_CONCURRENCYMax concurrent scrapesSCRAPER_TIMEOUTScrape timeout (seconds)Configuration
{"mcpServers": {"nia-link": {"command": "python", "args": ["/path/to/Nia-Link/app/mcp_server.py"]}}}