-
Notifications
You must be signed in to change notification settings - Fork 155
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(mcp_memory): add mcp server for memory
- Loading branch information
1 parent
2f37374
commit 3f565c4
Showing
13 changed files
with
1,083 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<parent> | ||
<groupId>run.mone</groupId> | ||
<artifactId>mcp</artifactId> | ||
<version>1.6.1-jdk21-SNAPSHOT</version> | ||
</parent> | ||
|
||
<artifactId>mcp-memory</artifactId> | ||
|
||
<properties> | ||
<maven.compiler.source>17</maven.compiler.source> | ||
<maven.compiler.target>17</maven.compiler.target> | ||
</properties> | ||
|
||
<build> | ||
|
||
<plugins> | ||
<plugin> | ||
<artifactId>maven-compiler-plugin</artifactId> | ||
<version>3.11.0</version> | ||
<configuration> | ||
<source>${maven.compiler.source}</source> | ||
<target>${maven.compiler.target}</target> | ||
<verbose>true</verbose> | ||
<encoding>UTF-8</encoding> | ||
<compilerArguments> | ||
<sourcepath>${project.basedir}/src/main/java</sourcepath> | ||
</compilerArguments> | ||
</configuration> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-maven-plugin</artifactId> | ||
<version>2.7.14</version> | ||
<configuration> | ||
<mainClass>run.mone.mcp.memory.MemoryMcpBootstrap</mainClass> | ||
<finalName>app</finalName> | ||
</configuration> | ||
<executions> | ||
<execution> | ||
<goals> | ||
<goal>repackage</goal> | ||
</goals> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
|
||
|
||
</plugins> | ||
|
||
</build> | ||
|
||
</project> |
13 changes: 13 additions & 0 deletions
13
jcommon/mcp/mcp-memory/src/main/java/run/mone/mcp/memory/MemoryMcpBootstrap.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package run.mone.mcp.memory; | ||
|
||
import org.springframework.boot.SpringApplication; | ||
import org.springframework.boot.autoconfigure.SpringBootApplication; | ||
import org.springframework.context.annotation.ComponentScan; | ||
|
||
@SpringBootApplication | ||
@ComponentScan("run.mone.mcp.memory") | ||
public class MemoryMcpBootstrap { | ||
public static void main(String[] args) { | ||
SpringApplication.run(MemoryMcpBootstrap.class, args); | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
jcommon/mcp/mcp-memory/src/main/java/run/mone/mcp/memory/config/McpStdioTransportConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package run.mone.mcp.memory.config; | ||
|
||
import com.fasterxml.jackson.databind.ObjectMapper; | ||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; | ||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.Configuration; | ||
import run.mone.hive.mcp.server.transport.StdioServerTransport; | ||
|
||
@Configuration | ||
@ConditionalOnProperty(name = "stdio.enabled", havingValue = "true") | ||
class McpStdioTransportConfig { | ||
/** | ||
* stdio 通信 | ||
* @param mapper | ||
* @return | ||
*/ | ||
@Bean | ||
StdioServerTransport stdioServerTransport(ObjectMapper mapper) { | ||
return new StdioServerTransport(mapper); | ||
} | ||
} |
Oops, something went wrong.