Logo de LLMCore

LLMCore

Comunidade
Palm1r

Qt C++ library for working with AI/LLM Providers and MCP

Publicado porPalm1r
Repositóriollmqore
IdiomaC++
Forks
13
Estrelas
47
Ferramentas disponíveis
0
Tipo de transportestdio
Categorias
LicençaMIT
Links
  • Conecte ferramentas a fluxos de trabalho de IA

    LLMCore disponibiliza recursos MCP que podem ser usados por clientes e agentes de IA compatíveis.

  • 0 ferramentas disponíveis

    Confira abaixo as ações que podem ser chamadas, incluindo nomes e descrições quando fornecidos pelo servidor.

  • Configuração pronta para copiar

    Use os exemplos de instalação para configurar este servidor no seu cliente MCP preferido.

  • Indicadores da comunidade de código aberto

    47 estrelas e 13 forks no repositório vinculado.

LLMQore

Build and Test GitHub Tag

Qt/C++ library for cloud and local LLM providers, MCP clients and servers, and ACP agents. Streaming deltas arrive as Qt signals on the object's own thread, async results as QFuture, ownership follows QObject parent-child. Links against Core, Network and Concurrent.

What it does

  • LLM REST API — cloud and local: Claude, OpenAI Chat Completions, OpenAI Responses, Google AI, Mistral, DeepSeek, Qwen, Ollama, llama.cpp; streaming or buffered, images in, reasoning out, token usage, cancellation
  • Tool calling — your BaseTool subclass, tool loop included, gated by QFuture<bool> if you want
  • MCP — client and server over stdio, Streamable HTTP or legacy SSE, sharing one tool registry; mcp-bridge CLI puts many upstream servers behind one endpoint
  • Conversation — one history, translated into each provider's shape, portable between them
  • ACP host — any agent in the JSON registry; ships Claude Code and Codex

LLM REST API

Ask and await the answer:

cpp
auto *client = new LLMQore::ClaudeClient(
    "https://api.anthropic.com", apiKey, "claude-sonnet-4-5", this);

client->askOnce("What is Qt?").then(this, [this](const LLMQore::CompletionInfo &result) {
    m_view->setPlainText(result.fullText);
});

Or watch it arrive, which is what you want in a chat panel:

cpp
connect(client, &LLMQore::BaseClient::accumulatedReceived,
        this, [this](const LLMQore::RequestID &, const QString &answer) {
    m_view->setPlainText(answer);
});

client->ask("What is Qt?");

accumulatedReceived carries the whole answer so far; chunkReceived carries only the new delta. Both are emitted on the client's own thread, so a direct connection into a widget or model is safe.

→ Quick Start

Tool calling

Expose a function over data the provider cannot see — the open document, the current selection, a local database:

cpp
client->tools()->addTool(new SearchCurrentFileTool(client));

conversation.addUser("Where do we handle the timeout?");
client->ask(conversation);

The client drives the loop: the model requests the tool, executeAsync runs, the result is sent back, the model answers. setMaxToolContinuations() bounds it, ten rounds by default. toolStarted and toolResultReady report progress; setExecutionGate() gates each call behind a QFuture<bool>.

→ Quick Start · LLM clients

MCP

Using external tools

Tools from an MCP server enter the same registry and reach the model through the same tool-definition array:

cpp
client->tools()->addMcpServer({.name = "filesystem", .command = "npx",
    .arguments = {"-y", "@modelcontextprotocol/server-filesystem", "/home/user"}});

client->tools()->loadMcpServers(QJsonDocument::fromJson(configData).object());

loadMcpServers reads the mcpServers object Claude Desktop uses and returns how many servers it registered:

json
{
  "mcpServers": {
    "filesystem": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-filesystem", "/home/user"]
    }
  }
}

Serving your own tools

McpServer::setToolRegistry takes the same ToolsManager the client uses, so one registration serves both the in-process model and any MCP client that connects:

cpp
auto *server = new LLMQore::Mcp::McpServer(
    new LLMQore::Mcp::McpHttpServerTransport({.port = 8080, .path = "/mcp"}, this),
    cfg, this);

server->setToolRegistry(client->tools());
server->start();

The registry is shared, not copied: a tool added later reaches both sides, and the server forwards toolsChanged as notifications/tools/list_changed.

Use HTTP inside a running application. McpStdioServerTransport takes over the process's stdin and stdout, which only works when the process is nothing but an MCP server.

→ Quick Start

Bridging transports

mcp-bridge is a CLI built on the same client and server. It connects to several upstream MCP servers and re-exposes their tools behind one HTTP/SSE endpoint or one stdio server, for when the upstreams and the client disagree on transport.

bash
mcp-bridge bridge.json              # HTTP endpoint
mcp-bridge --stdio bridge.json      # stdio

Prebuilt binaries with the Qt runtime bundled are on Releases.

→ MCP Bridge

Local models

OllamaClient and LlamaCppClient derive from the same BaseClient as the hosted providers and accept an empty API key:

cpp
auto *client = new LLMQore::OllamaClient("http://localhost:11434", {}, "llama3", this);

The conversation, the tools and the signals are the same; only the constructor differs.

→ Supported providers

Conversation

cpp
LLMQore::Conversation conversation;
conversation.setSystem("Answer in one sentence.");
conversation.addUser("What is Qt?");

client->ask(conversation);

Providers disagree on nearly every name: messages against contents, assistant against model, a top-level system field against a system message inside the array. One serializeTurn per provider does the translation, and CompletionInfo::conversation returns the history including the turns the model added during tool rounds.

A turn holds a list of content, so an image is another block in it:

cpp
conversation.addUser({
    LLMQore::TextContent{"What does this chart show?"},
    LLMQore::ImageContent::fromBytes(png, "image/png")});

→ LLM clients

ACP host

The reverse direction: the agent owns the model and the tool loop, LLMQore is the host. It launches Claude Code or Codex over stdio, streams session/update as Qt signals, and answers the agent's session/request_permission, fs/* and terminal/* calls.

cpp
using namespace LLMQore::Acp;

AcpAgentRegistry registry;
registry.loadFromFile("agents.json");

auto *agent = new AcpClient(
    registry.config("claude", QDir::currentPath())->createTransport(this), {}, this);
agent->setFileSystemProvider(new DefaultFileSystemProvider(this));
agent->setTerminalProvider(new TerminalManager(this));

connect(agent, &AcpClient::agentMessageChunk,
        this, [](const QString &, const ContentBlock &c) { /* render c.text */ });

agent->connectAndInitialize();   // then newSession() -> prompt()

AcpAgentRegistry reads agents from JSON, overridable with LLMQORE_ACP_AGENTS. No API key travels through the protocol — the agent authenticates itself.

→ ACP host · authentication

Example application

example-chat is a Qt Quick application covering all eight providers, MCP servers and an ACP agent. Build with -DLLMQORE_BUILD_EXAMPLES=ON.

Supported providers

ProviderClient classStreamingToolsImages inReasoning parsedReasoning replayed
Anthropic ClaudeClaudeClient✓✓✓✓✓ signature
OpenAI (Chat Completions)OpenAIClient✓✓✓✓✓ when received
OpenAI (Responses API)OpenAIResponsesClient✓✓✓✓opt-in
Google AIGoogleAIClient✓✓✓✓✓ thought signature
OllamaOllamaClient✓✓✓✓✓
MistralMistralClient✓✓✓✓✓ when received
llama.cppLlamaCppClient✓✓✓✓✓ when received
DeepSeekOpenAIClient✓✓✓✓✓ when received
Qwen (DashScope)OpenAIClient✓✓✓✓✓ when received

Reasoning parsed means thinking blocks reach you as signals. Reasoning replayed means they go back into the next request in the form that provider requires — without which some models reject a continuation that follows a tool call. The Responses API needs store: false to make this work, so it is a switch rather than a default; see LLM clients.

MCP is implemented for the 2025-11-25 spec over stdio and Streamable HTTP — server side: tools, resources, resource templates, prompts, completions, sampling, elicitation; client side: the same plus roots.

Requirements

  • C++20
  • Qt 5.15 or Qt 6.5+
  • CMake 3.21+

CI builds and tests Qt 6.8.3 and 6.10.2 on Linux, macOS and Windows, and Qt 5.15.2 on Linux. Versions inside the stated range but outside that matrix are expected to work and are not verified on every commit. The Qt Quick example is Qt 6 only.

Documentation

Support

  • Report Issues: open an issue on GitHub
  • Contribute: pull requests with bug fixes or new features are welcome
  • Spread the Word: star the repository and share with fellow developers
  • Financial Support:
    • Paypal: paypal page
    • Bitcoin (BTC): bc1qndq7f0mpnlya48vk7kugvyqj5w89xrg4wzg68t
    • Ethereum (ETH): 0xA5e8c37c94b24e25F9f1f292a01AF55F03099D8D
    • Litecoin (LTC): ltc1qlrxnk30s2pcjchzx4qrxvdjt5gzuervy5mv0vy
    • USDT (TRC20): THdZrE7d6epW6ry98GA3MLXRjha1DjKtUx

License

MIT — see LICENSE.

Instalação

TypingMind
Pré-requisitos:

Node.js 18+

{
  "mcpServers": {
    "palm1r-llmcore": {
      "command": "",
      "args": []
    }
  }
}

Use o MCP de LLMCore com vários modelos de IA

O TypingMind conecta as ferramentas MCP no nível do espaço de trabalho. Assim, após conectar LLMCore, é possível usá-lo com diferentes modelos de IA no TypingMind, em vez de configurá-lo separadamente para cada modelo. Este MCP é executado localmente no seu dispositivo por meio do conector MCP do TypingMind.

Guia de configuração para usar o conector local

Use esta opção quando o servidor MCP precisar acessar arquivos locais, aplicativos ou recursos privados no seu computador.

1

Abra as configurações de MCP

No TypingMind, vá até Configurações, Configurações avançadas e depois Model Context Protocol e selecione Configurar conector.

  1. Abra o TypingMind no navegador.
  2. Clique no ícone de Ajustes.
  3. Acesse Configurações avançadas.
  4. Abra a seção Model Context Protocol.
  5. Clique em Configurar conector e selecione Este dispositivo.
Tela de configuração do conector MCP do TypingMind com a opção Este dispositivo selecionada
2

Execute o comando do conector

Selecione Este dispositivo, copie o comando do TypingMind e execute-o no Terminal. Mantenha o processo em execução enquanto usa o MCP.

  1. Copie o comando de configuração exibido pelo TypingMind.
  2. Abra o Terminal no macOS ou o Windows Terminal no Windows.
  3. Cole e execute o comando.
  4. Autorize a instalação do pacote se o Terminal pedir confirmação para continuar.
  5. Mantenha o processo em execução na janela do Terminal enquanto usa as ferramentas MCP.
3

Adicione LLMCore como servidor

Quando o status do conector for Pronto, clique em Editar e cole a configuração do servidor MCP.

  1. Aguarde até que o status do conector mostre Pronto.
  2. Clique em Editar.
  3. Cole a configuração do servidor MCP de LLMCore.
  4. Salve a lista de servidores.
  5. Atualize para confirmar se o conector ainda está pronto para uso.
Configurações de MCP do TypingMind mostrando um servidor ativo e o botão Editar
{
  "mcpServers": {
    "palm1r-llmcore": {
      "command": "npx",
      "args": [
        "-y",
        "llmcore"
      ]
    }
  }
}
4

Use a conexão com diferentes modelos

Salve a lista de servidores, abra Plugins, ative as ferramentas MCP de LLMCore, selecione qualquer modelo de IA compatível no TypingMind e use as ferramentas no chat ou atribua-as a um agente de IA.

  1. Abra a página Plugins no TypingMind.
  2. Ative as ferramentas MCP de LLMCore.
  3. Inicie um chat e escolha o modelo de IA que deseja usar.
  4. Use as ferramentas MCP no chat ou atribua-as a um agente de IA.
  5. Mude para outro modelo de IA sempre que necessário, sem reconectar o MCP.
Chat do TypingMind usando ferramentas MCP ativadas com um modelo de IA selecionado
Pode usar LLMCore para me ajudar nesta tarefa?
LLMCore
Claro. Já li.
Veja o que encontrei usando LLMCore.

Perguntas frequentes

Para que serve o servidor MCP LLMCore?

LLMCore é um servidor MCP que permite que aplicativos de IA compatíveis se conectem a ferramentas externas e informações de contexto. No TypingMind, basta adicionar esse servidor MCP uma vez para disponibilizar suas ferramentas no seu espaço de trabalho com IA.

Posso usar o MCP LLMCore com vários modelos de IA no TypingMind?

Sim. O TypingMind conecta as ferramentas MCP no nível do espaço de trabalho, permitindo usar LLMCore com diferentes modelos de IA, como Claude, ChatGPT, Gemini ou outros modelos configurados no TypingMind, sem configurar o servidor MCP separadamente para cada modelo.

Por que usar o MCP LLMCore com o TypingMind?

O TypingMind é uma das melhores interfaces de chat com LLMs porque reúne vários modelos de IA, prompts, plugins, agentes de IA, chaves de API e ferramentas MCP em um só espaço de trabalho. Com LLMCore conectado, é possível usar suas ferramentas MCP nos seus modelos preferidos e manter seu fluxo de trabalho de chat organizado no TypingMind.

Como conecto o MCP LLMCore ao TypingMind?

LLMCore funciona por meio do conector MCP local do TypingMind. Essa é a melhor opção quando o servidor MCP precisa acessar arquivos locais, apps de desktop, ferramentas de linha de comando ou recursos privados no seu computador.

Quais ferramentas o MCP LLMCore oferece no TypingMind?

LLMCore disponibiliza recursos MCP que podem ser ativados na página Plugins do TypingMind e usados no chat ou atribuídos a agentes de IA.

Preciso compartilhar minhas chaves de API com o TypingMind para usar o MCP LLMCore?

Não. O TypingMind prioriza o uso local e permite manter seus provedores de modelos, chaves de API, prompts e configuração MCP sob seu controle. Se LLMCore exigir autenticação, adicione os cabeçalhos, as configurações OAuth ou a configuração local exigidos por esse servidor MCP ao criar a conexão.

Servidores MCP relacionados

Ver todos

Crie seu próprio espaço de IA agora

Inscreva-se na nossa newsletter para receber novidades sobre recursos e futuros sorteios 👇