Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ Copy [`mcp.json.example`](./mcp.json.example) to `.mcp.json` in your project roo
{
"mcpServers": {
"yaci-devkit": {
"url": "http://localhost:10000/sse"
"url": "http://localhost:10000/mcp"
}
}
}
Expand Down
20 changes: 9 additions & 11 deletions applications/cli/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
plugins {
id 'org.springframework.boot' version '3.2.5'
id 'io.spring.dependency-management' version '1.1.4'
id 'org.springframework.boot' version '3.5.11'
id 'io.spring.dependency-management' version '1.1.7'
id 'org.graalvm.buildtools.native' version '0.10.2'
id 'java'
id 'signing'
Expand All @@ -18,17 +18,16 @@ java {
}

repositories {
//maven { url 'https://repo.spring.io/release' }
mavenCentral()
mavenLocal()
maven {
url "https://oss.sonatype.org/content/repositories/snapshots"
url "https://central.sonatype.com/repository/maven-snapshots/"
}
}

ext {
set('springShellVersion', "3.2.4")
set('springAiVersion', "1.0.3")
set('springShellVersion', "3.4.1")
set('springAiVersion', "1.1.2")
}

dependencies {
Expand All @@ -39,13 +38,12 @@ dependencies {
implementation 'org.springframework.boot:spring-boot-starter-logging'
implementation 'org.springframework.boot:spring-boot-starter-mustache'

implementation('com.bloxbean.cardano:yaci:0.3.3') {
implementation('com.bloxbean.cardano:yaci:0.4.0') {
exclude group: 'com.bloxbean.cardano', module: 'cardano-client-core'
}
implementation 'com.bloxbean.cardano:cardano-client-lib:0.6.2'
implementation 'com.bloxbean.cardano:cardano-client-backend:0.6.2'
implementation 'com.bloxbean.cardano:cardano-client-backend-blockfrost:0.6.2'
//implementation 'com.bloxbean.cardano:cardano-client-supplier-local:0.5.1'
implementation 'com.bloxbean.cardano:cardano-client-lib:0.7.1'
implementation 'com.bloxbean.cardano:cardano-client-backend:0.7.1'
implementation 'com.bloxbean.cardano:cardano-client-backend-blockfrost:0.7.1'

implementation 'org.apache.commons:commons-compress:1.23.0'

Expand Down
5 changes: 0 additions & 5 deletions applications/cli/docker/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,3 @@ pool.keys.home=/clusters/pool-keys
spring.shell.config.location=/clusters
server.port=10000

# MCP Server
spring.ai.mcp.server.enabled=true
spring.ai.mcp.server.name=yaci-devkit
spring.ai.mcp.server.version=0.1.0

Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import org.springframework.web.bind.MethodArgumentNotValidException;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;
import org.springframework.web.servlet.resource.NoResourceFoundException;

import java.util.HashMap;
import java.util.Map;
Expand Down Expand Up @@ -56,6 +57,20 @@ public ResponseEntity<Map<String, Object>> handleIllegalArgumentException(
return ResponseEntity.badRequest().body(response);
}

/**
* Handle missing static resource requests (e.g., MCP client probing legacy endpoints)
*/
@ExceptionHandler(NoResourceFoundException.class)
public ResponseEntity<Map<String, Object>> handleNoResourceFoundException(
NoResourceFoundException ex) {
Map<String, Object> response = new HashMap<>();
response.put("code", HttpStatus.NOT_FOUND.value());
response.put("message", "Resource not found");

log.debug("Resource not found: {}", ex.getMessage());
return ResponseEntity.status(HttpStatus.NOT_FOUND).body(response);
}

/**
* Handle generic exceptions
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -221,23 +221,6 @@ private CliConnection getConnectionInfo(String host, int port, String network, l
wellKnownPoint = new Point(slot, blockHash);
else
wellKnownPoint = Constants.WELL_KNOWN_MAINNET_POINT;
} else if ("legacy_testnet".equals(network)) {
if (!StringUtils.hasLength(host)) {
host = Constants.TESTNET_IOHK_RELAY_ADDR;
}

if (port == 0) {
port = Constants.TESTNET_IOHK_RELAY_PORT;
}

if (protocolMagic == 0) {
protocolMagic = Constants.LEGACY_TESTNET_PROTOCOL_MAGIC;
}

if (slot != 0 && StringUtils.hasLength(blockHash))
wellKnownPoint = new Point(slot, blockHash);
else
wellKnownPoint = Constants.WELL_KNOWN_TESTNET_POINT;
} else if ("preprod".equals(network)) {
if (!StringUtils.hasLength(host)) {
host = Constants.PREPROD_IOHK_RELAY_ADDR;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,10 @@ public ProtocolParams getProtocolParams() {
protocolParams.setPoolDeposit(String.valueOf(protocolParamUpdate.getPoolDeposit()));
protocolParams.setEMax(protocolParamUpdate.getMaxEpoch());
protocolParams.setNOpt(protocolParamUpdate.getNOpt());
protocolParams.setA0(protocolParamUpdate.getPoolPledgeInfluence());
protocolParams.setRho(protocolParamUpdate.getExpansionRate());
protocolParams.setTau(protocolParamUpdate.getTreasuryGrowthRate());
protocolParams.setDecentralisationParam(protocolParamUpdate.getDecentralisationParam()); //Deprecated. Not there
protocolParams.setA0(protocolParamUpdate.getPoolPledgeInfluence() != null? protocolParamUpdate.getPoolPledgeInfluence().safeRatio(): null);
protocolParams.setRho(protocolParamUpdate.getExpansionRate() != null? protocolParamUpdate.getExpansionRate().safeRatio(): null);
protocolParams.setTau(protocolParamUpdate.getTreasuryGrowthRate() != null? protocolParamUpdate.getTreasuryGrowthRate().safeRatio(): null);
protocolParams.setDecentralisationParam(protocolParamUpdate.getDecentralisationParam() != null? protocolParamUpdate.getDecentralisationParam().safeRatio(): null); //Deprecated. Not there
//protocolParams.setExtraEntropy(protocolParamUpdate.getExtraEntropy()); //TODO
protocolParams.setProtocolMajorVer(protocolParamUpdate.getProtocolMajorVer());
protocolParams.setProtocolMinorVer(protocolParamUpdate.getProtocolMinorVer());
Expand All @@ -90,8 +90,8 @@ public ProtocolParams getProtocolParams() {

protocolParams.setCostModels(costModels);

protocolParams.setPriceMem(protocolParamUpdate.getPriceMem());
protocolParams.setPriceStep(protocolParamUpdate.getPriceStep());
protocolParams.setPriceMem(protocolParamUpdate.getPriceMem() != null? protocolParamUpdate.getPriceMem().safeRatio(): null);
protocolParams.setPriceStep(protocolParamUpdate.getPriceStep() != null? protocolParamUpdate.getPriceStep().safeRatio(): null);
protocolParams.setMaxTxExMem(String.valueOf(protocolParamUpdate.getMaxTxExMem()));
protocolParams.setMaxTxExSteps(String.valueOf(protocolParamUpdate.getMaxTxExSteps()));
protocolParams.setMaxBlockExMem(String.valueOf(protocolParamUpdate.getMaxBlockExMem()));
Expand Down
4 changes: 4 additions & 0 deletions applications/cli/src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,15 @@ spring:
location: classpath:/banner.txt
devtools:
add-properties:logging: false
shell:
interactive:
enabled: true
ai:
mcp:
server:
name: yaci-devkit
version: 0.1.0
protocol: STATELESS

logging:
level:
Expand Down
22 changes: 19 additions & 3 deletions applications/cli/src/main/resources/logback-spring.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
</encoder>
<file>${LOG_FILE}</file>
<rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
<param name="FileNamePattern" value="${LOG_FILE}.%i"/>
<param name="MinIndex" value="1"/>
<param name="MaxIndex" value="20"/>
<fileNamePattern>${LOG_FILE}.%i</fileNamePattern>
<minIndex>1</minIndex>
<maxIndex>20</maxIndex>
</rollingPolicy>
<triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
<MaxFileSize>10MB</MaxFileSize>
Expand All @@ -21,6 +21,22 @@
<pattern>%clr(%d){faint} %clr(${PID:- }){magenta} %clr([%15.15t]){magenta} %clr(%-5p) %clr(%-40c{40}){cyan} - %m%n</pattern>
</encoder>
</appender>

<!-- Tomcat socket errors go to file only, not to the CLI prompt -->
<logger name="org.apache.tomcat.util.net" level="ERROR" additivity="false">
<appender-ref ref="FILE"/>
</logger>

<!-- MCP protocol negotiation warnings go to file only, not to the CLI prompt -->
<logger name="io.modelcontextprotocol" level="WARN" additivity="false">
<appender-ref ref="FILE"/>
</logger>

<!-- Spring AI MCP provider startup warnings go to file only -->
<logger name="org.springframework.ai.mcp" level="WARN" additivity="false">
<appender-ref ref="FILE"/>
</logger>

<root level="WARN">
<appender-ref ref="CONSOLE"/>
<appender-ref ref="FILE"/>
Expand Down
2 changes: 1 addition & 1 deletion mcp.json.example
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"mcpServers": {
"yaci-devkit": {
"url": "http://localhost:10000/sse"
"url": "http://localhost:10000/mcp"
}
}
}
Loading