Skip to content

Commit a7ce75f

Browse files
comments
1 parent 7669e93 commit a7ce75f

3 files changed

Lines changed: 20 additions & 1 deletion

File tree

api/src/org/labkey/api/mcp/AbstractAgentAction.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@
1313

1414
import static org.apache.commons.lang3.StringUtils.isNotBlank;
1515

16+
/**
17+
* "agent" it is too strong a word, but if you want to create a tools specific chat endpoint then
18+
* start here.
19+
* First implement getServicePrompt() to tell your "agent its mission. You can also listen in on the
20+
* conversation to help you user get the right results.
21+
*/
1622
public abstract class AbstractAgentAction<F extends PromptForm> extends ReadOnlyApiAction<F>
1723
{
1824
protected abstract String getAgentName();

api/src/org/labkey/api/mcp/McpContext.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@
99
import org.springframework.ai.chat.model.ToolContext;
1010
import java.util.Map;
1111

12+
/**
13+
* TODO MCP tool calling supports passing along a ToolContext. And most all
14+
* interesting tools probably need a User and Container. This is not all hooked-up
15+
* yet. This is an area for further investiation.
16+
*/
1217
public class McpContext implements ContainerUser
1318
{
1419
final User user;

api/src/org/labkey/api/mcp/McpService.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,15 @@
1919
import java.util.List;
2020
import java.util.function.Supplier;
2121

22-
22+
/**
23+
* This service lets you expose functionality over the MCP protocol (only simple http for now). This allows
24+
* external chat sessions to pull information from LabKey Server. These methods are also made available
25+
* to chat session shosted by LabKey (see AbstractAgentAction).
26+
* <p></p>
27+
* These calls are not security checked. Any tools registered here must check user permissions. Maybe that
28+
* will come as we get further along. Note that the LLM may make callbacks concerning containers other than the
29+
* current container. This is an area for investigation.
30+
*/
2331
public interface McpService extends ToolCallbackProvider
2432
{
2533
// marker interface for classes that we will "ingest" using Spring annotations

0 commit comments

Comments
 (0)