Skip to content

Commit

Permalink
feat(mcp_memory): add mcp server for memory
Browse files Browse the repository at this point in the history
  • Loading branch information
HawickMason committed Jan 21, 2025
1 parent 2f37374 commit 3f565c4
Show file tree
Hide file tree
Showing 13 changed files with 1,083 additions and 1 deletion.
57 changes: 57 additions & 0 deletions jcommon/mcp/mcp-memory/pom.xml
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>
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);
}
}
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);
}
}
Loading

0 comments on commit 3f565c4

Please sign in to comment.