شعار Chanakya Local Friend

Chanakya Local Friend

مؤسسة
samosa-ai-com

Chanakya is an advanced, open-source, and self-hostable voice assistant designed for privacy, power, and flexibility. It leverages local AI/ML models to ensure your data stays with you. It Integrates with 1000+ third-party MCP servers including Home Assistant.

الناشرsamosa-ai-com
المستودعChanakya-Local-Friend
اللغةPython
التفريعات
17
النجوم
214
الأدوات المتاحة
0
نوع نقل البياناتstdio
الروابط
  • اربط الأدوات بمسارات عمل الذكاء الاصطناعي

    يتيح Chanakya Local Friend إمكانات MCP لتطبيقات الذكاء الاصطناعي العميلة المتوافقة معه، وكذلك لوكلاء الذكاء الاصطناعي المتوافقين معه.

  • الأدوات المتاحة: 0

    تصفّح الإجراءات القابلة للاستدعاء أدناه، بما في ذلك أسماؤها وأوصافها عندما يوفّرها الخادم.

  • إعدادات جاهزة للنسخ

    استخدم مقتطفات التثبيت لتهيئة هذا الخادم في تطبيق MCP العميل المفضّل لديك.

  • مؤشرات اهتمام المجتمع بالمستودع مفتوح المصدر

    إحصاءات المستودع المرتبط: النجوم: 214، والتفريعات: 17.

Chanakya

Chanakya is an advanced, open-source, and self-hostable voice assistant designed for privacy, power, and flexibility. It can leverage local AI/ML models to help keep data under your control and supports connecting to third-party MCP servers through configuration. A network of intelligent agents collaborates to complete tasks, provide insights, and maintain ongoing workflows.

  • Chanakya Flask app on http://127.0.0.1:5513
  • AIR service on http://127.0.0.1:5512
  • Conversation layer on http://127.0.0.1:5514
  • Optional A2A bridge on http://127.0.0.1:18770

The most important setup rule is simple: create the repo-root .env and mcp_config_file.json before starting the stack. The startup scripts read those files immediately.

Quick Start

1. Prerequisites

  • Python 3.11 is the safest default for local development.
  • python3.11 -m venv available on your machine.
  • uvx available if you use the example MCP config as-is.
  • An OpenAI-compatible API key and base URL.

2. Create the virtual environment

From the repo root:

bash
python3.11 -m venv .venv
source .venv/bin/activate
python -m pip install --upgrade pip
python -m pip install -e .[dev]
python -m pip install -e ./apps/AI-Router-AIR
python -m pip install -e ./apps/chanakya_conversation_layer

If you prefer conda for day-to-day development, that is still fine. The only hard requirement is that the systemd installer expects a repo-root .venv.

3. Create .env before starting anything

Start from the checked-in template:

bash
cp .env.example .env

Then edit .env for your machine and credentials. Use .env.example as the source of truth for supported variables.

The startup scripts source this file automatically and export ENV_FILE_PATH for child processes. If this file is missing, the services start without your intended runtime configuration.

4. Create mcp_config_file.json before starting anything

The app expects a repo-root mcp_config_file.json.

Start from the example:

bash
cp mcp_config_file.example.json mcp_config_file.json

Then edit it for your environment if needed. Use mcp_config_file.example.json as the source of truth for the default MCP server layout. The checked-in example includes both local Python-backed MCP servers and uvx-launched servers.

5. Start the stack

Core stack:

bash
./scripts/start_chanakya_air.sh core

Core stack plus A2A components:

bash
./scripts/start_chanakya_air.sh core+a2a

Open the main UI at http://127.0.0.1:5513.

6. Stop the stack

bash
./scripts/stop_chanakya_air.sh

What The Startup Script Does

./scripts/start_chanakya_air.sh starts the current local stack in this order:

  1. AIR service
  2. Chanakya conversation layer
  3. Optional A2A services for core+a2a
  4. Chanakya Flask app

It also:

  • reads .env from the repo root unless ENV_FILE_PATH is already set
  • writes PID files and logs under build/runtime/
  • prints the service URLs after startup

Use ./scripts/stop_chanakya_air.sh to stop everything cleanly.

Required Configuration

.env

Start from .env.example and copy it into place:

bash
cp .env.example .env

Then edit .env with your local values. Replace all placeholder values marked with <...>:

VariableDescriptionExample
OPENAI_BASE_URLYour LM Studio or OpenAI-compatible server endpointhttp://127.0.0.1:1234/v1
OPENAI_API_KEYAPI key for your model serverlm-studio (or your key)
DATABASE_URLPath to your SQLite databasesqlite:////home/user/chanakya_data/chanakya.db

The defaults in .env.example use placeholder values and will not work out of the box.

Common variables used in local development include:

bash
CHANAKYA_CORE_AGENT_BACKEND=local
A2A_AGENT_URL=http://127.0.0.1:18770
AIR_SERVER_PORT=5512
CHANAKYA_PORT=5513
CONVERSATION_LAYER_PORT=5514

mcp_config_file.json

Start from the checked-in template:

bash
cp mcp_config_file.example.json mcp_config_file.json

This file defines the MCP servers Chanakya can connect to. The example file already includes entries for:

  • mcp_websearch
  • mcp_fetch
  • mcp_calculator
  • mcp_code_execution
  • mcp_filesystem
  • mcp_git
  • mcp_http
  • mcp_json
  • mcp_shell_utils
  • mcp_weather
  • mcp_map
  • mcp_timer
  • mcp_work_tools
  • mcp_artifact_tools

If you add or remove MCP servers, restart the stack afterward so the tool loader reconnects using the updated config.

Local Development

Test, lint, and type-check

From the repo root with the environment activated:

bash
pytest apps/chanakya/test
python -m ruff check apps/chanakya/
python -m mypy apps/chanakya/

For a focused test run:

bash
pytest apps/chanakya/test/test_agent_manager.py -q

Database utilities

bash
python scripts/db_viewer.py
python scripts/update_database.py
python scripts/clear_database.py

Notes:

  • scripts/clear_database.py is destructive.
  • If DATABASE_URL is unset, the default SQLite database is chanakya_data/chanakya.db.

Manual smoke checks

These rely on external tooling and are not the default verification path:

bash
python scripts/run_maf_tools.py
python scripts/test_mcp_fetch_connectivity.py --mode with-wrapper
python scripts/test_mcp_fetch_connectivity.py --mode without-wrapper

Runtime Files

Runtime state is written under chanakya_data/ and build/runtime/.

  • chanakya_data/ holds application state such as the SQLite database and shared workspace data.
  • build/runtime/ holds PID files and service logs from the startup scripts.

If something fails to boot, check the recent logs in build/runtime/ first.

Service Installation On Ubuntu

The repo includes a systemd installer for the core stack:

bash
sudo ./scripts/install-autostart-ubuntu.sh

Important details:

  • it requires a repo-root .venv
  • it passes ENV_FILE_PATH pointing at the repo-root .env
  • it installs services for the invoking non-root user by default

Useful commands:

bash
sudo systemctl status chanakya.target
sudo journalctl -u chanakya-air.service -f
sudo journalctl -u chanakya-conversation-layer.service -f
sudo journalctl -u chanakya-app.service -f
sudo systemctl restart chanakya.target

Uninstall:

bash
sudo ./scripts/uninstall-autostart-ubuntu.sh

Repository Layout

This workspace contains a few related codebases. The main ones are:

  • apps/chanakya/: primary Flask app, routes, templates, core state, tests
  • apps/AI-Router-AIR/: FastAPI service used by the local stack on port 5512
  • apps/chanakya_conversation_layer/: separate conversation-layer package and tests
  • scripts/: startup, shutdown, database, and service-management scripts

If you are changing runtime behavior, the most relevant files are usually:

  • apps/chanakya/core/app.py
  • apps/chanakya/core/chat_service.py
  • apps/chanakya/core/store.py
  • apps/chanakya/agent/runtime.py
  • apps/chanakya/templates/
  • apps/chanakya/static/js/air_voice.js

Common Problems

The stack starts but behaves incorrectly

Check these first:

  1. .env exists at the repo root and has the expected model credentials.
  2. mcp_config_file.json exists at the repo root.
  3. The virtual environment includes all three editable installs.
  4. build/runtime/*.log shows all services stayed up after startup.

A service starts with the wrong environment

The startup scripts source the repo-root .env automatically. If you want a different env file, set ENV_FILE_PATH before invoking the script.

MCP tools are missing

Confirm that:

  1. the tool exists in mcp_config_file.json
  2. its command is installed on your machine
  3. you restarted the stack after editing the MCP config

Related Files

  • mcp_config_file.example.json: starting point for MCP server configuration
  • scripts/start_chanakya_air.sh: standard local stack entrypoint
  • scripts/stop_chanakya_air.sh: standard shutdown entrypoint
  • scripts/install-autostart-ubuntu.sh: systemd installer for Linux

استخدم MCP الخاص بـ Chanakya Local Friend مع نماذج ذكاء اصطناعي متعددة

يربط TypingMind أدوات MCP على مستوى مساحة العمل، لذا بمجرد توصيل Chanakya Local Friend، يمكنك استخدامه مع نماذج ذكاء اصطناعي مختلفة في TypingMind بدلًا من إعداده لكل نموذج على حدة. يعمل تكامل MCP هذا محليًا عبر موصل MCP الخاص بـ TypingMind على جهازك.

دليل الإعداد لاستخدام الموصل المحلي

استخدم هذا الخيار عندما يحتاج خادم MCP إلى الوصول إلى ملفات محلية أو تطبيقات أو موارد خاصة على جهاز الكمبيوتر لديك.

1

فتح إعدادات MCP

في TypingMind، انتقل إلى «الإعدادات»، ثم «الإعدادات المتقدمة»، ثم «بروتوكول سياق النموذج»، واختر «إعداد الموصل».

  1. افتح TypingMind في متصفحك.
  2. انقر على أيقونة الإعدادات.
  3. انتقل إلى الإعدادات المتقدمة.
  4. افتح قسم بروتوكول سياق النموذج.
  5. انقر على «إعداد الموصل» واختر «هذا الجهاز».
شاشة إعداد موصل MCP في TypingMind مع تحديد «هذا الجهاز»
2

تنفيذ أمر الموصل

اختر «هذا الجهاز»، وانسخ الأمر من TypingMind وشغّله في Terminal. أبقِ العملية قيد التشغيل أثناء استخدام MCP.

  1. انسخ أمر الإعداد الذي يعرضه TypingMind.
  2. افتح Terminal على macOS أو Windows Terminal على Windows.
  3. الصق الأمر ونفّذه.
  4. وافق على تثبيت الحزمة إذا طلب منك Terminal تأكيد المتابعة.
  5. أبقِ نافذة Terminal مفتوحة واترك العملية قيد التشغيل أثناء استخدام أدوات MCP.
3

إضافة Chanakya Local Friend كخادم

عندما تظهر حالة الموصل «جاهز»، انقر على «تعديل الخوادم» والصق إعدادات خادم MCP.

  1. انتظر حتى تظهر حالة الموصل «جاهز».
  2. انقر على «تعديل الخوادم».
  3. الصق إعدادات خادم MCP الخاص بـ Chanakya Local Friend.
  4. احفظ قائمة الخوادم.
  5. حدّث الحالة إذا أردت التأكد من أن الموصل لا يزال جاهزًا.
إعدادات MCP في TypingMind تعرض خادمًا نشطًا وزر «تعديل الخوادم»
{
  "mcpServers": {
    "chanakya-local-friend": {
      "command": "npx",
      "args": [
        "-y",
        "<mcp-server-package>"
      ]
    }
  }
}
4

استخدام الاتصال مع نماذج مختلفة

احفظ قائمة الخوادم، وافتح «الإضافات»، وفعّل أدوات MCP الخاصة بـ Chanakya Local Friend، ثم اختر أي نموذج ذكاء اصطناعي مدعوم في TypingMind واستخدم الأدوات في المحادثة أو أسندها إلى وكيل ذكاء اصطناعي.

  1. افتح صفحة الإضافات في TypingMind.
  2. فعّل أدوات MCP الخاصة بـ Chanakya Local Friend.
  3. ابدأ محادثة واختر نموذج الذكاء الاصطناعي الذي تريد استخدامه.
  4. استخدم أدوات MCP في المحادثة أو عيّنها لوكيل ذكاء اصطناعي.
  5. انتقل إلى نموذج ذكاء اصطناعي آخر عند الحاجة دون إعادة الاتصال بـ MCP.
محادثة في TypingMind تستخدم أدوات MCP المفعّلة مع نموذج ذكاء اصطناعي محدّد
هل يمكنك استخدام Chanakya Local Friend لمساعدتي في هذه المهمة؟
Chanakya Local Friend
بالتأكيد. قرأته.
إليك ما وجدته باستخدام Chanakya Local Friend.

الأسئلة الشائعة

ما استخدامات خادم MCP Chanakya Local Friend؟

Chanakya Local Friend هو خادم MCP يتيح لتطبيقات الذكاء الاصطناعي المتوافقة الاتصال بأدوات ومصادر سياق خارجية. في TypingMind، يمكنك إضافة خادم MCP هذا مرة واحدة وإتاحة أدواته في مساحة عملك للذكاء الاصطناعي.

هل يمكنني استخدام خادم MCP Chanakya Local Friend مع نماذج ذكاء اصطناعي متعددة في TypingMind؟

نعم. يربط TypingMind أدوات MCP على مستوى مساحة العمل، لذا يمكنك استخدام Chanakya Local Friend مع نماذج ذكاء اصطناعي مختلفة مثل Claude أو ChatGPT أو Gemini أو غيرها من النماذج التي أعددتها في TypingMind، دون إعداد خادم MCP لكل نموذج على حدة.

لماذا تستخدم خادم MCP Chanakya Local Friend مع TypingMind؟

يُعد TypingMind من أفضل واجهات المحادثة مع النماذج اللغوية الكبيرة، إذ يجمع نماذج ذكاء اصطناعي متعددة ومطالبات وإضافات ووكلاء ذكاء اصطناعي ومفاتيح API وأدوات MCP في مساحة عمل واحدة. بعد توصيل Chanakya Local Friend، يمكنك استخدام أدوات MCP الخاصة به عبر نماذجك المفضلة مع الحفاظ على سير عمل محادثاتك منظمًا في TypingMind.

كيف أوصّل خادم MCP Chanakya Local Friend بـ TypingMind؟

يعمل Chanakya Local Friend عبر موصل MCP المحلي في TypingMind. هذا هو الخيار الأنسب عندما يحتاج خادم MCP إلى الوصول إلى ملفات محلية أو تطبيقات سطح المكتب أو أدوات سطر الأوامر أو موارد خاصة على حاسوبك.

ما الأدوات التي يوفّرها خادم MCP Chanakya Local Friend في TypingMind؟

يتيح Chanakya Local Friend إمكانات MCP يمكنك تفعيلها من صفحة الإضافات في TypingMind واستخدامها في المحادثات أو تعيينها لوكلاء ذكاء اصطناعي.

هل أحتاج إلى مشاركة مفاتيح API الخاصة بي مع TypingMind لاستخدام خادم MCP Chanakya Local Friend؟

لا. يعطي TypingMind الأولوية للعمل المحلي ويتيح لك التحكم بنفسك في مزوّدي النماذج ومفاتيح API والمطالبات وإعدادات MCP. إذا كان Chanakya Local Friend يتطلب مصادقة، فأضف الترويسات أو إعدادات OAuth أو الإعدادات المحلية المطلوبة لخادم MCP هذا عند إنشاء الاتصال.

خوادم MCP ذات صلة

عرض الكل

أنشئ مساحة عملك للذكاء الاصطناعي الآن

اشترك في نشرتنا الإخبارية لتصلك أخبار الميزات الجديدة والهدايا القادمة 👇