Skip to content

Commit a4cd4d5

Browse files
committed
1 parent d95288d commit a4cd4d5

9 files changed

Lines changed: 200 additions & 6 deletions

File tree

index.html

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

index.xml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Home on http4k</title><link>https://http4k.org/</link><description>Recent content in Home on http4k</description><generator>Hugo</generator><language>en-us</language><lastBuildDate>Fri, 28 Mar 2025 00:00:00 +0000</lastBuildDate><atom:link href="https://http4k.org/index.xml" rel="self" type="application/rss+xml"/><item><title>Connect Overview</title><link>https://http4k.org/ecosystem/connect/concepts/pattern/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://http4k.org/ecosystem/connect/concepts/pattern/</guid><description>&lt;p>The main bulk of non-operationally focussed application code in a modern Server-based HTTP microservice can be broken
1+
<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Home on http4k</title><link>https://http4k.org/</link><description>Recent content in Home on http4k</description><generator>Hugo</generator><language>en-us</language><lastBuildDate>Fri, 09 May 2025 00:00:00 +0000</lastBuildDate><atom:link href="https://http4k.org/index.xml" rel="self" type="application/rss+xml"/><item><title>Connect Overview</title><link>https://http4k.org/ecosystem/connect/concepts/pattern/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://http4k.org/ecosystem/connect/concepts/pattern/</guid><description>&lt;p>The main bulk of non-operationally focussed application code in a modern Server-based HTTP microservice can be broken
22
down into a few broad areas:&lt;/p></description></item><item><title>Core</title><link>https://http4k.org/ecosystem/http4k/reference/core/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://http4k.org/ecosystem/http4k/reference/core/</guid><description>&lt;h3 id="installation-gradle">Installation (Gradle)&lt;/h3>
33
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-kotlin" data-lang="kotlin">&lt;span style="display:flex;">&lt;span>dependencies {
44
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
@@ -260,7 +260,8 @@ down into a few broad areas:&lt;/p></description></item><item><title>Core</title
260260
&lt;td>&lt;/td>
261261
&lt;/tr>
262262
&lt;/tbody>
263-
&lt;/table></description></item><item><title>http4k Core</title><link>https://http4k.org/ecosystem/http4k/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://http4k.org/ecosystem/http4k/</guid><description/></item><item><title>Your first http4k app</title><link>https://http4k.org/tutorial/your_first_http4k_app/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://http4k.org/tutorial/your_first_http4k_app/</guid><description>&lt;p>Welcome to the world of http4k! In this guide, we&amp;rsquo;ll run you through the steps required to get up and running with your first Kotlin server application. We&amp;rsquo;ll generate the project, make some requests to it and then build it into a runnable application. By the end, you&amp;rsquo;ll have a fully working app built packaged and tested using the Gradle build tool.&lt;/p></description></item><item><title>http4k Connect</title><link>https://http4k.org/ecosystem/connect/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://http4k.org/ecosystem/connect/</guid><description/></item><item><title>Serverless http4k with AWS Lambda</title><link>https://http4k.org/tutorial/serverless_http4k_with_aws_lambda/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://http4k.org/tutorial/serverless_http4k_with_aws_lambda/</guid><description>&lt;p>In this guide, we&amp;rsquo;ll run you through the steps required to get an http4k application deployed and running on AWS Lambda and available to call over the internet using AWS ApiGateway. If you&amp;rsquo;re not familiar with the http4k concepts for HTTP and Serverless apps, then we advise you read them &lt;a href="https://http4k.org/ecosystem/http4k/concepts/http/">here&lt;/a> and &lt;a href="https://http4k.org/ecosystem/http4k/concepts/serverless/">here&lt;/a>. To make an app you can follow the &lt;a href="https://http4k.org/tutorial/your_first_http4k_app/">Your first http4k app&lt;/a> tutorial before tackling this guide.&lt;/p></description></item><item><title>Going native with Graal on AWS Lambda</title><link>https://http4k.org/tutorial/going_native_with_graal_on_aws_lambda/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://http4k.org/tutorial/going_native_with_graal_on_aws_lambda/</guid><description>&lt;p>In this guide, we&amp;rsquo;ll run you through the steps required to get an http4k application deployed and running on AWS Lambda with GraalVM and available to call over the internet using AWS ApiGateway. If you&amp;rsquo;re not familiar with the http4k concepts for HTTP and Serverless apps, then we advise you read them &lt;a href="https://http4k.org/ecosystem/http4k/concepts/http/">here&lt;/a> and &lt;a href="https://http4k.org/ecosystem/http4k/concepts/serverless/">here&lt;/a>. To make an app you can follow the &lt;a href="https://http4k.org/tutorial/your_first_http4k_app/">Your first http4k app&lt;/a> tutorial. Then follow the steps in the &lt;a href="https://http4k.org/tutorial/serverless_http4k_with_aws_lambda/">Serverless http4k with AWS Lambda&lt;/a> tutorial before tackling this guide.&lt;/p></description></item><item><title>http4k MCP Has Landed: Build Your Own AI Agents with Zero Compromise on Testability!</title><link>https://http4k.org/news/http4k_mcp_has_landed/</link><pubDate>Fri, 28 Mar 2025 00:00:00 +0000</pubDate><guid>https://http4k.org/news/http4k_mcp_has_landed/</guid><description>&lt;img class="imageMid my-4" src="./http4k-mcp.png" alt="http4k MCP logo"/>
263+
&lt;/table></description></item><item><title>http4k Core</title><link>https://http4k.org/ecosystem/http4k/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://http4k.org/ecosystem/http4k/</guid><description/></item><item><title>Your first http4k app</title><link>https://http4k.org/tutorial/your_first_http4k_app/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://http4k.org/tutorial/your_first_http4k_app/</guid><description>&lt;p>Welcome to the world of http4k! In this guide, we&amp;rsquo;ll run you through the steps required to get up and running with your first Kotlin server application. We&amp;rsquo;ll generate the project, make some requests to it and then build it into a runnable application. By the end, you&amp;rsquo;ll have a fully working app built packaged and tested using the Gradle build tool.&lt;/p></description></item><item><title>http4k Connect</title><link>https://http4k.org/ecosystem/connect/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://http4k.org/ecosystem/connect/</guid><description/></item><item><title>Serverless http4k with AWS Lambda</title><link>https://http4k.org/tutorial/serverless_http4k_with_aws_lambda/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://http4k.org/tutorial/serverless_http4k_with_aws_lambda/</guid><description>&lt;p>In this guide, we&amp;rsquo;ll run you through the steps required to get an http4k application deployed and running on AWS Lambda and available to call over the internet using AWS ApiGateway. If you&amp;rsquo;re not familiar with the http4k concepts for HTTP and Serverless apps, then we advise you read them &lt;a href="https://http4k.org/ecosystem/http4k/concepts/http/">here&lt;/a> and &lt;a href="https://http4k.org/ecosystem/http4k/concepts/serverless/">here&lt;/a>. To make an app you can follow the &lt;a href="https://http4k.org/tutorial/your_first_http4k_app/">Your first http4k app&lt;/a> tutorial before tackling this guide.&lt;/p></description></item><item><title>Going native with Graal on AWS Lambda</title><link>https://http4k.org/tutorial/going_native_with_graal_on_aws_lambda/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://http4k.org/tutorial/going_native_with_graal_on_aws_lambda/</guid><description>&lt;p>In this guide, we&amp;rsquo;ll run you through the steps required to get an http4k application deployed and running on AWS Lambda with GraalVM and available to call over the internet using AWS ApiGateway. If you&amp;rsquo;re not familiar with the http4k concepts for HTTP and Serverless apps, then we advise you read them &lt;a href="https://http4k.org/ecosystem/http4k/concepts/http/">here&lt;/a> and &lt;a href="https://http4k.org/ecosystem/http4k/concepts/serverless/">here&lt;/a>. To make an app you can follow the &lt;a href="https://http4k.org/tutorial/your_first_http4k_app/">Your first http4k app&lt;/a> tutorial. Then follow the steps in the &lt;a href="https://http4k.org/tutorial/serverless_http4k_with_aws_lambda/">Serverless http4k with AWS Lambda&lt;/a> tutorial before tackling this guide.&lt;/p></description></item><item><title>Simplifying MCP: http4k's Updated Authentication Model - Less Code, More Power</title><link>https://http4k.org/news/simplifying-mcp/</link><pubDate>Fri, 09 May 2025 00:00:00 +0000</pubDate><guid>https://http4k.org/news/simplifying-mcp/</guid><description>&lt;img class="imageMid my-4" src="./http4k-oauth-mcp.png" alt="http4k MCP logo"/>
264+
&lt;p>We&amp;rsquo;re excited to share a significant update to our &lt;a href="https://mcp.http4k.org">http4k Model Context Protocol (MCP) SDK&lt;/a>! 🚀. Based on community feedback and our commitment to making AI integration as frictionless as possible, we&amp;rsquo;ve streamlined the authentication model in our latest release.&lt;/p></description></item><item><title>http4k MCP Has Landed: Build Your Own AI Agents with Zero Compromise on Testability!</title><link>https://http4k.org/news/http4k_mcp_has_landed/</link><pubDate>Fri, 28 Mar 2025 00:00:00 +0000</pubDate><guid>https://http4k.org/news/http4k_mcp_has_landed/</guid><description>&lt;img class="imageMid my-4" src="./http4k-mcp.png" alt="http4k MCP logo"/>
264265
&lt;p>We&amp;rsquo;re thrilled to announce the launch of the http4k &lt;a href="https://mcp.http4k.org">Model Context Protocol (MCP) SDK&lt;/a>! 🚀
265266
This powerful addition to the http4k ecosystem brings seamless AI integration capabilities to your applications through
266267
a clean, functional API that stays true to http4k&amp;rsquo;s core principles.&lt;/p></description></item><item><title>http4k v6: Still the most testable web toolkit on the planet!*</title><link>https://http4k.org/news/http4k-v6-still-the-most-testable-web-toolkit-on-the-planet/</link><pubDate>Sat, 01 Feb 2025 00:00:00 +0000</pubDate><guid>https://http4k.org/news/http4k-v6-still-the-most-testable-web-toolkit-on-the-planet/</guid><description>&lt;img class="imageMid my-4" src="./takeoff.png" alt="http4k logo"/>

news/index.html

Lines changed: 2 additions & 2 deletions
Large diffs are not rendered by default.

news/simplifying-mcp/client.kt

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
package content.news.`simplifying-mcp`
2+
3+
import content.news.http4k_mcp_has_landed.cityArg
4+
import org.http4k.client.JavaHttpClient
5+
import org.http4k.connect.model.ToolName
6+
import org.http4k.core.Credentials
7+
import org.http4k.core.Uri
8+
import org.http4k.core.then
9+
import org.http4k.filter.ClientFilters
10+
import org.http4k.lens.with
11+
import org.http4k.mcp.ToolRequest
12+
import org.http4k.mcp.client.DiscoveredMcpOAuth
13+
import org.http4k.mcp.client.http.HttpStreamingMcpClient
14+
import org.http4k.mcp.model.McpEntity
15+
import org.http4k.mcp.protocol.Version
16+
17+
val clientCredentials = Credentials("clientId", "clientSecret")
18+
val autoDiscoveryHttp = ClientFilters.DiscoveredMcpOAuth(clientCredentials)
19+
.then(JavaHttpClient())
20+
21+
// Create an MCP client
22+
val client = HttpStreamingMcpClient(McpEntity.of("My Client"), Version.of("1.0.0"),
23+
Uri.of("http://localhost:3000/mcp"),
24+
autoDiscoveryHttp
25+
).apply { start() }
26+
27+
// Call tools programmatically
28+
val toolResponse = client.tools().call(
29+
ToolName.of("weather"),
30+
ToolRequest().with(cityArg of "London"),
31+
)
32+
106 KB
Loading

news/simplifying-mcp/index.html

Lines changed: 136 additions & 0 deletions
Large diffs are not rendered by default.

news/simplifying-mcp/oauth.png

36.9 KB
Loading

news/simplifying-mcp/server.kt

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
package content.news.`simplifying-mcp`
2+
3+
import org.http4k.core.Uri
4+
import org.http4k.mcp.ToolResponse
5+
import org.http4k.mcp.model.Content
6+
import org.http4k.mcp.model.McpEntity
7+
import org.http4k.mcp.model.Tool
8+
import org.http4k.mcp.protocol.ServerMetaData
9+
import org.http4k.mcp.protocol.Version
10+
import org.http4k.mcp.server.security.OAuthMcpSecurity
11+
import org.http4k.routing.bind
12+
import org.http4k.routing.mcpHttpStreaming
13+
import org.http4k.server.JettyLoom
14+
import org.http4k.server.asServer
15+
import java.time.Instant
16+
17+
fun main() {
18+
mcpHttpStreaming(
19+
ServerMetaData(McpEntity.of("foo"), Version.of("bar")),
20+
OAuthMcpSecurity(Uri.of("https://oauth-server")) { it == "my_oauth_token" },
21+
Tool("time", "Get the current time") bind {
22+
ToolResponse.Ok(listOf(Content.Text(Instant.now().toString())))
23+
}
24+
).asServer(JettyLoom(3001)).start()
25+
}

0 commit comments

Comments
 (0)