1C Database Queries for Agents

1c-llm-requests

A tiny 1C extension with an HTTP service plus a skill, so an agent writes 1C queries itself and gets database data as TSV

SkillMedium riskRussian stack

fserg/1c-llm-requests

Install

./.claude/skills/1c-queries/scripts/query-1c.sh 'ВЫБРАТЬ ПЕРВЫЕ 10 Кассы.Код, Кассы.Наименование ИЗ Справочник.Кассы КАК Кассы'

Check the script from the project root after filling .env.

This is third-party code. Review the repository files before installing.

What it does

The extension publishes an HTTP service that accepts a 1C query text, checks its syntax and returns the result as a delimited table. The 1c-queries skill gives the agent bash and PowerShell scripts that read the URL and credentials from .env, plus detailed query writing rules: no ampersand parameters, always a FIRST N limit, reference comparison through attributes. This lets the agent investigate why a document fails to post using real data, or run ad hoc analysis. The author recommends pairing it with a metadata MCP so the agent reads the structure first.

Who it is for. For 1C developers and analysts who investigate errors and data in an infobase with an agent.

Good fit when

  • You need to see why a document fails to post using actual data
  • You need a one-off data analysis without building a report
  • You need to verify that a 1C query is valid and returns what you expect

Not a fit when

  • Infobase data must not be sent to an external model
  • You need to modify data: the service is read-only

Example request

Why does receipt ССНФ-000002 from January 2 fail to post? Check the data in the infobase

Limitations

The agent reads any data the 1C user can see, including personal data: privacy is the infobase owner's responsibility, and the author suggests anonymizing data. You must install the extension and publish the HTTP service on a web server or via the standalone ibsrv server. The infobase login and password live in .env inside the skill folder.

How to disable. Delete .claude/skills/1c-queries from the project and disable the АПРО_ВнешниеЗапросы extension or the HTTP service publication.

Security check

  • The agent reads data from a working infobase, including personal data
  • Infobase credentials are stored in a .env file

README in short

The README explains that the extension is about twenty lines of code and grew out of debugging posting errors on real data. Quick start: install the extension, publish the HTTP service for a client-server or file infobase, test it with curl and fill the skill's .env. The author stresses the detailed SKILL.md and query syntax validation as agent feedback, shows sample reports and lists alternative solutions. MIT license.

SKILL.md

---
name: 1c-queries
description: Выполняет запросы к базе данных 1С:Предприятие через HTTP-сервис. Используй этот навык когда нужно получить данные из 1С, выполнить анализ данных в базе 1С, написать или проверить запрос на языке 1С.
---

# Выполнение запросов к базе 1С:Предприятие

## Обзор

Этот навык позволяет выполнять запросы к базе данных 1С:Предприятие через HTTP-сервис. Используй его для анализа данных и получения информации из 1С.

## Скрипты для выполнения запросов

Скрипты читают `.env` автоматически и отправляют запрос в 1С.

**Windows (PowerShell):**

```powershell
.\.claude\skills\1c-queries\scripts\query-1c.ps1 -Query 'ВЫБРАТЬ Кассы.Код, Кассы.Наименование ИЗ Справочник.Кассы КАК Кассы ГДЕ Кассы.Наименование = "Основная касса"'
```

**Linux (bash):**

```bash
./.claude/skills/1c-queries/scripts/query-1c.sh 'ВЫБРАТЬ Кассы.Код, Кассы.Наименование ИЗ Справочник.Кассы КАК Кассы ГДЕ Кассы.Наименование = "Основная касса"'
```

## Формат ответа

- Ответ в формате TSV (Tab-Separated Values)
- Первая строка — заголовки колонок
- Следующие строки — данные
- При ошибке: HTTP 400 с описанием ошибки

FAQ

Can the agent break anything in the infobase?

According to the author, no: the service only runs read queries. But the agent can read everything the user has access to.

Why TSV instead of JSON?

A delimited table uses far fewer tokens, and models read it well.

Editors’ pick

166 skills for scientific work: bioinformatics, cheminformatics, clinical data, geospatial analysis and 100+ databases

SkillMedium risk44.9K
Editors’ pick

Google's open-source MCP server for databases: ready tools for Postgres, MySQL, BigQuery, Spanner and more, plus custom tools in tools.yaml

MCP serverHigh risk16.4K
Editors’ pick

A token-lean MCP server for PostgreSQL, MySQL, MariaDB, SQL Server and SQLite with a read-only mode

MCP serverHigh risk3.5K
Editors’ pick

Official MongoDB MCP server: queries and aggregations, index management, Atlas clusters and local deployments

MCP serverHigh risk1.1K