English translation for research convenience. The Russian original remains the authoritative source.
CasusLegal CasusLegal Higher-court case-law corpus ← Home

Connect to AnythingLLM

Five steps, about two minutes. AnythingLLM runs on your computer or server, so connecting differs from Claude and ChatGPT. There is no login window here, and access is provided via a personal token from your account.

All screenshots below were taken in AnythingLLM version 1.16. The interface is identical in the desktop application and the server installation.

Which address to connect. All databases are available at one address: higher courts, the IP Court, the Judicial Chamber for Administrative Cases, the Judicial Chamber for Criminal Cases and ten commercial cassation districts. Exactly the databases you have paid for are opened; the appropriate neural network selects itself based on the subject of the question.
What is requiredAddress (URL)
All paid databases, including the districtshttps://mcp.casus.legal/one/mcp
Former district address /okrug/mcp continues to work; you do not need to reconnect it. If both addresses are connected, disable /okrug/mcp: otherwise the neural network will see the district tools twice.
⚠️ Environment without a guarantee. Guaranteed to be supported Claude, ChatGPT, Grok and Hermes — the connector has been tested in them. AnythingLLM works according to the same MCP standard; the instructions below have been tested on a live installation, but we do not guarantee the stability of a particular build or version.
Database access. Welcome free requests in the web chat and Telegram bot do not apply to the connector. Before connecting, enable in your account a three-day free trial or subscribe to the required database.

What you will need

On the CasusLegal side
Active access and a token

A subscription or trial period for the required database and a personal token of the form vasrf_conn_…. The token is issued using a button in the account and is displayed only once.

On the AnythingLLM side
A version with MCP support

Either the desktop application or the server installation will work. You need the section Agent Skills with the block MCP Servers, which is available in current versions.

Any model you have already configured will work: the connector is not tied to it.

1
Issue a token in your account

Open account, the tab “Connectors”, block “Other environments” and click “Issue token”. A token of the form vasrf_conn_… is displayed once, so copy it immediately. Only its hash is stored in the database.

The token remains valid while the subscription is active and opens all paid databases. It does not disrupt already configured Claude and ChatGPT connections; existing connections continue to work with their own tokens.

Treat it like a password: it provides access to your subscription. If the token has been exposed or lost, issue a new one using the same button and replace the value in the settings.

2
Open the MCP Servers section

In AnythingLLM click the settings gear and select Agent Skills in the left-hand column. Scroll down the page: below the blocks Custom Skills and Agent Flows is located MCP Servers.

Nothing has been added yet; it says No MCP servers found, and a button is shown next to it Refresh — you will need it in step 4.

AnythingLLM settings, Agent Skills section. At the bottom of the page is the MCP Servers block with a Refresh button and the text No MCP servers found.
Section Agent Skills. At the bottom is the MCP Servers block with a Refresh button; the list is empty for now.
3
Describe the server in the configuration

Servers are defined by a file anythingllm_mcp_servers.json in the folder storage/plugins of your installation: for the server build, this is the directory you mounted; for the desktop application, it is its data folder. Create the file if it does not yet exist and insert:

storage/plugins/anythingllm_mcp_servers.json

{ "mcpServers": { "casuslegal": { "type": "streamable", "url": "https://mcp.casus.legal/one/mcp", "headers": { "Authorization": "Bearer vasrf_conn_your_token" } } } }

The connection address is https://mcp.casus.legal/one/mcp. This is a single address: it provides access to all databases covered by your subscription, and it automatically selects the appropriate AI model based on the subject of the question. If you need a connector for a single database, separate addresses are also available (IP Court — https://sip.casus.legal/mcp, KAS — https://kas.casus.legal/mcp, KUD — https://kud.casus.legal/mcp), but the address must then match the database covered by your subscription; otherwise, the server will respond “the subscription is inactive or has expired.” There is no need to keep both the single address and separate addresses at the same time: the AI model will see two identical sets of tools and search twice. The complete table of addresses is below, under the steps.

The server type is required streamable. Our address uses the Streamable HTTP protocol, and with the value sse the connection cannot be established. This is the most common error during the initial connection.

Write the server name ("casuslegal") in Latin characters. Tool identifiers cannot be generated internally from a Cyrillic name, and the model will not see them.

If you need several databases, add a block like this for each one, changing the name and address from the table below. The token is the same in all blocks.

4
Refresh the server list

Return to Agent Skills → MCP Servers and click Refresh. The server will appear in the list under the name from the configuration.

The status Running means that the connection has been established. Click the server to see the list of tools: casuslegal_search_practice, casuslegal_get_case_details and the others. The status Stopped (as shown in the screenshot) means that the server has not started. Most often, the cause is an incorrect or expired token or the wrong sse instead of streamable.

MCP Servers block after clicking Refresh: the Casuslegal server appears in the list with the status Stopped.
After Refresh the server appears in the list. The screenshot shows the Stopped: this is what a connection with an invalid token looks like.
5
Ask via @agent

MCP tools are available only in agent mode, so start your message with @agent. For example: “@agent find Supreme Court of the Russian Federation case law on reducing a penalty under Article 333 of the Civil Code of the Russian Federation”.

The tools connected to the conversation are shown in the menu Tools below the input field. The slash commands and agent skills are listed there as well.

The first search takes about 30 seconds because the connector runs several sub-searches across the corpus. The response should include the details of the decisions with links to the full texts.

AnythingLLM chat window with the Tools menu expanded: Slash Commands and Agent Skills tabs.
Menu Tools in the chat window: this shows what is available to the agent in this conversation.

Addresses: single and database-specific

Each database is connected as a separate server in the same file. The token is shared and provides access to all databases covered by your subscription.

DatabaseServer nameAddress (URL)
All subscribed databases at oncecasuslegalhttps://mcp.casus.legal/one/mcp
Commercial cassation districts (all)casuslegal-okrugahttps://mcp.casus.legal/okrug/mcp
Higher courts: Constitutional Court · Supreme Court · Supreme Commercial Courtcasuslegalhttps://mcp.casus.legal/mcp
Intellectual Property Court (IP Court)casuslegal-siphttps://sip.casus.legal/mcp
Administrative cases (KAS · Judicial Chamber for Administrative Cases of the Supreme Court of the Russian Federation)casuslegal-kashttps://kas.casus.legal/mcp
Criminal cases (KUD · Judicial Chamber for Criminal Cases of the Supreme Court of the Russian Federation)casuslegal-kudhttps://kud.casus.legal/mcp

Typical errors

The server is listed, but its status is Stopped

This is what an unsuccessful connection looks like. The three most common causes are: the server type sse instead of streamable, a typo in the token (an extra space, a missing character, or a missing word Bearer before the value), or an expired subscription.

Check the access period in the “Connectors” tab of your account, and if in doubt, issue a new token and click Refresh.

The server is Running, but tools are not called in the chat

The message was sent without the prefix @agent. The regular model responds instead and does not access the connector.

The second reason is a Cyrillic server name in the configuration. Rewrite it in Latin characters and refresh the list.

The response returns a rate_limited error

Protection against anomalous load has been triggered. It does not trigger during ordinary legal work (dozens of requests per day); if the message appears at a normal pace, write to us at support — we will investigate it for your account.

A long response is cut off

A single corpus search takes about 30 seconds, and a complex question triggers several searches in succession. If your build terminates the call due to a timeout, increase the tool wait limit in the agent settings.

Several databases are needed at once

In the same file, add one block for each address in the table above, using different server names. The subscription remains the same, and the token provides access to all subscribed databases.

The token has been lost

It is not shown again. Issue a new one in your account and replace the value in the configuration; existing connections will not be disconnected.

RU