Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2025-10

LLM / MCP

1 message · 1 person ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Michael Van Canneyt

Hi,

For those that are busy with LLM and MCP:

I've created 2 repos:

https://gitlab.com/freepascal.org/llm

This contains client-side classes that allow you to use the APIs of the major LLM vendors (OpenAI, Anthropic, Google Gemini and OLLama, JanAI). There is an example for each API.

The intent is to use this to allow using any LLM in the lazarus IDE.

For people that want to go a step further:

The following repo contains an implementation of the MCP (Model Context Protocol):

https://gitlab.com/freepascal.org/mcp

The MCP protocol allows you to write a tool that is usable by most AI agents today. What you can do with the classes is to write an MCP server which is then used by the agent (and allows the LLM to execute commands).

As an example, there is a MCP server that allows an Agent to execute SQL queries on any FPC-supported database. It allows one to ask to retrieve information from the database in natural language. The agent will then transform the natural language to SQL and retrieve the result. I've had surpringly good results using Google Gemini.

The tool by default does not allow to modify the data or structure of the database. Since retrieved data is sent to a LLM, be careful not to send any personal data over the line for privacy reasons.

Articles describing how to use this will follow.

Michael.

Reply by email