File tree Expand file tree Collapse file tree
api/src/org/labkey/api/mcp Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1313
1414import 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+ */
1622public abstract class AbstractAgentAction <F extends PromptForm > extends ReadOnlyApiAction <F >
1723{
1824 protected abstract String getAgentName ();
Original file line number Diff line number Diff line change 99import org .springframework .ai .chat .model .ToolContext ;
1010import 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+ */
1217public class McpContext implements ContainerUser
1318{
1419 final User user ;
Original file line number Diff line number Diff line change 1919import java .util .List ;
2020import 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+ */
2331public interface McpService extends ToolCallbackProvider
2432{
2533 // marker interface for classes that we will "ingest" using Spring annotations
You can’t perform that action at this time.
0 commit comments