Featured

Deploy OpenClaw in 60 seconds — 20% off logoDeploy OpenClaw in 60 seconds — 20% off

Launch OpenClaw on Hostinger in about 60 seconds and keep your agent live 24/7. Our referral link gives you 20% off, no coupon code needed.

Launch on Hostinger
Run your Hermes agent on Hostinger, fully managed logoRun your Hermes agent on Hostinger, fully managed

Launch Hermes on Hostinger in one click, fully managed, no VPS knowledge needed. Use code ZACAARON10 for 10% off.

Launch on Hostinger
Crawl and scrape any site into clean data, 10% off logoCrawl and scrape any site into clean data, 10% off

Firecrawl crawls and scrapes any site into clean markdown for your agent. Get 1,000 free credits, and new users get 10% off their first purchase.

Try Firecrawl free
Your own AI agent, running 24/7 with QwikClaw logoYour own AI agent, running 24/7 with QwikClaw

QwikClaw sets up and runs an always-on OpenClaw agent for you. One click, no config files, no server setup.

Deploy now
One API to scrape, enrich, and extract the internet. logoOne API to scrape, enrich, and extract the internet.

Context.dev gives your agents a single API to scrape, enrich, and extract live web data — no proxies, no parsers, no maintenance.

Start building free
SetupClaw: done-for-you OpenClaw for founders & exec teams logoSetupClaw: done-for-you OpenClaw for founders & exec teams

White-glove OpenClaw for founders and exec teams (4–50+ employees): we install, harden, integrate your tools, and maintain it — secured from day one.

Get it set up for you
SEO data APIs for your agent, $1 free credit logoSEO data APIs for your agent, $1 free credit

DataForSEO gives your agent live access to SERP results, keyword data, backlinks, and on-page SEO data through one API. New accounts get a $1 credit, good for up to 20,000 keyword or backlink lookups.

Try DataForSEO free
Reach 47,000+ AI builders

A flat monthly placement in front of developers actively installing AI tools. No lock-in, cancel anytime.

Advertise here

Works with

Claude CodeClaude DesktopCursorVS CodeClineCodex CLIOpenClaw+ any MCP client

Install to Claude Code

This server doesn't publish a one-line install command. Follow the setup in the source repository.

Summary

Enables fast, on-device machine learning with production-grade persistence through the Model Context Protocol. It allows instant training of text classifiers using Extreme Learning Machines, with SurrealDB-backed persistence and monitoring.

README.md

AsterMind-ELM MCP Server

A local Model Context Protocol server for training small text classifiers with Extreme Learning Machines (ELMs). It supports in-memory inference and optional SurrealDB persistence, prediction monitoring, and vector storage.

Is it useful?

Yes, for focused classification tasks where data must stay under your control and rapid retraining matters. Good candidates include intent routing, spam or content categorization, support-ticket triage, and lightweight labeling aids.

It is not a general semantic-search model or a production ML platform. The generate_embedding tool exposes a trained ELM's task-specific hidden features; it does not use a pretrained language model and should not be described as a semantic embedding without evaluation on the intended corpus.

Capabilities

  • Train multi-class text classifiers from labeled examples.
  • Predict labels and return ranked confidence scores.
  • Generate model-specific hidden-feature vectors.
  • Keep multiple models in memory and inspect their metadata.
  • Optionally store and reload versioned models and datasets in SurrealDB.
  • Optionally log predictions and calculate accuracy, latency, label counts, a

confusion matrix, and distribution drift.

  • Store arbitrary equal-dimension vectors and search them with cosine

similarity.

The server exposes 16 MCP tools:

  • Core: train_classifier, predict, generate_embedding, list_models,

delete_model, save_model

  • Persistence: store_model_persistent, load_model_persistent,

list_model_versions, store_training_dataset, load_training_dataset

  • Monitoring: get_model_metrics, get_confusion_matrix, detect_drift
  • Vector storage: store_embeddings, search_similar

save_model returns an in-memory summary. Use store_model_persistent when a model must survive a restart.

Requirements

  • Node.js 20.19+ or 22.12+
  • SurrealDB only when persistence is enabled

Install, build, and test

npm ci
npm run build
npm test

Additional commands:

npm run test:watch
npm run test:coverage
npm run watch

Coverage is enforced for the production TypeScript at 80% statements, 65% branches, 80% functions, and 80% lines. CI runs the locked dependency set on current Node.js 20, 22, and 24 releases, plus the persistence suite against a disposable SurrealDB service on Node.js 24.

MCP configuration

Build first, then point an MCP client at the compiled stdio entry point:

{
  "mcpServers": {
    "astermind-elm": {
      "command": "node",
      "args": ["/absolute/path/to/astermind-elm-mcp/build/index.js"]
    }
  }
}

The server writes protocol messages to stdout and diagnostics to stderr.

Minimal workflow

Call train_classifier:

{
  "model_id": "sentiment",
  "training_data": [
    { "text": "excellent purchase", "label": "positive" },
    { "text": "love this product", "label": "positive" },
    { "text": "terrible purchase", "label": "negative" },
    { "text": "hate this product", "label": "negative" }
  ],
  "config": {
    "hiddenUnits": 128,
    "activation": "relu"
  }
}

Then call predict:

{
  "model_id": "sentiment",
  "text": "I love this purchase",
  "top_k": 2
}

Use representative training and held-out evaluation data. Training success is not evidence that the classifier generalizes.

Optional SurrealDB persistence

The sample credentials below are for disposable local development only. Do not use them on a reachable database.

surreal start --log info --user root --pass root memory
npm run build
npm run init-db

Enable persistence in the MCP server environment:

{
  "ENABLE_PERSISTENCE": "true",
  "LOG_PREDICTIONS": "false",
  "SURREALDB_URL": "ws://127.0.0.1:8000/rpc",
  "SURREALDB_NAMESPACE": "astermind",
  "SURREALDB_DATABASE": "development",
  "SURREALDB_USERNAME": "root",
  "SURREALDB_PASSWORD": "root"
}

| Variable | Default | Meaning | | --- | --- | --- | | ENABLE_PERSISTENCE | false | Enable database-backed tools | | LOG_PREDICTIONS | false | Log predictions unless a call explicitly opts out | | SURREALDB_URL | ws://127.0.0.1:8000/rpc | SurrealDB RPC endpoint | | SURREALDB_NAMESPACE | astermind | Namespace | | SURREALDB_DATABASE | production | Database name | | SURREALDB_USERNAME | root | Database user | | SURREALDB_PASSWORD | root | Database password |

Persisted models are loaded explicitly with load_model_persistent; they are not automatically loaded after restart. If global prediction logging is on, "log_prediction": false disables it for an individual request. Prediction logging is best-effort and non-blocking: inference still returns when the database is slow or unavailable, and logging failures are reported on stderr.

Prediction records contain the input text. Enabling logging therefore changes the privacy boundary: protect the database, credentials, backups, and access logs appropriately. “Local” only means local when both the MCP client and the configured database endpoint are local.

Monitoring semantics

  • Accuracy and confusion matrices require predictions logged with

ground_truth.

  • Drift compares predicted-label distributions with Jensen-Shannon

divergence; it does not measure accuracy degradation or causal drift.

  • detect_drift returns status: "insufficient_data" and null drift fields if

either comparison window has no samples.

  • Monitoring queries currently materialize matching prediction rows in the

server, so benchmark and redesign aggregation before high-volume use.

Test layers

  • Unit tests cover validation, model lifecycle, encoding, persistence queries,

metrics, drift, and vector search.

  • Handler tests cover all 16 tool-dispatch paths and model serialization.
  • A real stdio MCP test starts the compiled child server and exercises protocol

discovery, training, prediction, and error responses.

  • SurrealDB integration tests are opt-in and require an initialized disposable

database:

npm run build
SURREALDB_URL=ws://127.0.0.1:8000/rpc \
SURREALDB_NAMESPACE=astermind_test \
SURREALDB_DATABASE=integration \
npm run init-db

SURREALDB_TEST_URL=ws://127.0.0.1:8000/rpc \
SURREALDB_TEST_NAMESPACE=astermind_test \
SURREALDB_TEST_DATABASE=integration \
npm run test:integration

Current limitations

  • There is no built-in train/validation split, evaluation dataset tool, model

selection, calibration analysis, or batch prediction API.

  • Confidence scores should not be treated as calibrated probabilities without

measurement.

  • Model records store serialized weights but are not encrypted by this server.
  • Database schema evolution is handled by the initialization script, not a

versioned migration system.

  • Vector search uses a database cosine-similarity query without a declared

vector index; it is not an approximate-nearest-neighbor service.

These constraints make the project best suited to local prototypes, personal automation, and bounded internal workloads until workload-specific evaluation, security review, and operational testing are complete.

Project structure

src/index.ts                         MCP schemas, server, and tool handlers
src/model-manager.ts                 In-memory model lifecycle
src/tool-validation.ts               Runtime input validation
src/text-features.ts                 Shared normalized text encoding
src/persistence/surrealdb-client.ts  Persistence and monitoring operations
src/scripts/init-db.ts               SurrealDB schema initialization
tests/                               Unit, handler, stdio, and DB integration tests

See PERSISTENCE_GUIDE.md for persistence examples. The proposal and completion-summary documents in the repository are historical and are not evidence of the current release quality.

License

MIT

See related servers & alternatives →

Related MCP servers

Browse all →

Related guides

Hand-picked reading to help you choose and use Observability servers.